read -d '' String <<"EOF"
ls
EOF
The above command basically assigns ls
into the variable String
. Now i use this
sshpass -p 'Ku99123' ssh -t kuhl@adf-sc-101.i.e.ibi.com 'cd /var/www/nginx/network ; eval $String && exec bash -l'
In the above command, i am trying to execute the command written in variable String
. But eval
is not working here. If i write simple ls
command instead of eval $String
, it works.
What syntactical or logical crime am i doing here?