I have a file with the format
(name of the file is old_ls_out )
14:00 config
18:01 abc
17:43 dsd
17:29 test134.txt
I want to initialize the file time and file name to 2 separate variables.In my shell script I use the code
LATEST_ARCHIVED_FILE_TIME = head -1 old_ls_out | nawk '{print $1}'
echo "Latest archived file time $LATEST_ARCHIVED_FILE_TIME "
LATEST_ARCHIVED_FILE_NAME = head -1 old_ls_out | nawk '{print $2}'
echo "Latest archived file name $LATEST_ARCHIVED_FILE_NAME "
I expect the output
Latest archived file time 14:00
Latest archived file name config
But instead what I get is
fm1[2]: LATEST_ARCHIVED_FILE_TIME: not found
Latest archived file time
fm1[4]: LATEST_ARCHIVED_FILE_NAME: not found
Latest archived file name
What is wrong with the code above ?
Cheers !
(name of the file is old_ls_out )
14:00 config
18:01 abc
17:43 dsd
17:29 test134.txt
I want to initialize the file time and file name to 2 separate variables.In my shell script I use the code
LATEST_ARCHIVED_FILE_TIME = head -1 old_ls_out | nawk '{print $1}'
echo "Latest archived file time $LATEST_ARCHIVED_FILE_TIME "
LATEST_ARCHIVED_FILE_NAME = head -1 old_ls_out | nawk '{print $2}'
echo "Latest archived file name $LATEST_ARCHIVED_FILE_NAME "
I expect the output
Latest archived file time 14:00
Latest archived file name config
But instead what I get is
fm1[2]: LATEST_ARCHIVED_FILE_TIME: not found
Latest archived file time
fm1[4]: LATEST_ARCHIVED_FILE_NAME: not found
Latest archived file name
What is wrong with the code above ?
Cheers !