I am trying to write a script to login to several remote servers and execute a script on each server. However, I would like to pass the variable through ssh. Something like that:
var="/home/dir/"
ssh -T $mchname <<'ENDSSH'
$var"run_script" < input > output &
ENDSSH
This naive attempt does not work ($ var is just null). What would be the correct syntax? Thanks in advance.
source
share