Have to assign variable with command results , I am using set of commands that to be executed in another server and results to be assigned in variable and process from it
The code goes like
Jump.Sh <username>@[host] > sample.csv << EOF #will navigate particular box whre following cmd executed
cd <dirname>
file=`ls -l <filename> | head -1` #the file returned ( but not assigned in variable)
a=`cat $file` #getting hanged after cat before the empty value of file
if [ -s $file ]
then
... code goes
fi
EOF
since the file is not getting assigned , i could store the contents in one variable which is to be used in the rest of the code and all other follwing codes are blocked . when examing sample.csv also the result does came
how to assign this variable