How to pass local variable to remote using ssh and bash script?
问题 ssh remotecluster 'bash -s' << EOF > export TEST="sdfsd" > echo $TEST > EOF This prints nothing. Also it still does not work even if I store the variable into file and copy it to remote. TEST="sdfsdf" echo $TEST > temp.par scp temp.par remotecluster ssh remotecluster 'bash -s' << EOF > export test2=`cat temp.par` > echo $test2 > EOF Still prints nothing. So my question is how to pass local variable to the remote machine as a variable ? Answers have been give in this 回答1: The variable