How to print index in a 'for-loop' being executed in remote host through SSH?
- by YShin
I want to ssh into a remote host, and then execute a for loop that goes through sequence of numbers to control number of different nodes.
ssh user@host /bin/bash << EOF
for i in {1..10}
do
echo $i
done
EOF
If I do this, the output is just 10 blank lines, instead of printing out numbers from 1 through 10.
If I execute same code on my local…