I am trying to write a script, where I have a loop to login to multiple remote machines and execute a script inside each machine. Here is an example:
for ((j=1; j < 2; j++)); do
mchname="n"$j
ssh -T $mchname <<'ENDSSH'
./run_script < input > output &
ENDSSH
done
Whenever I try to execute the above script I get: "warning: here-document at line 37 delimited by end-of-file (wanted `ENDSSH')"
I am new to ssh, so I am sure I am making a silly mistake. Can anyone suggest me a solution? Thanks.