i am trying to do a basic command of cat to a variable and it does not work..
lines="not working"
sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ' > $lines
echo $lines
./script.sh: line 34: $lines: ambiguous redirect
not working
the file exists. can anyone help me please?
Use `command`
or $(command)
. I.e.
lines=$(sshpass -p triltest ssh root@ILCFS 'cat /var/try/check ')
echo "$lines"