I have a really confusing error, in the following script. reservations is just a file with 100 lines, let's say something like this:
apple
pear
fruit
...
cat reservations | while read LINE;
do
echo $LINE
for i in {0..2}; do
ssh -o ConnectTimeout=10 admin@render rm -rf /tmp/lock$i
echo $i
done
done
(This is already a simplified version of a production script.)
Now, what I would have expected, is to see an output like this:
apple
0
1
2
pear
0
1
2
...
BUT, I only get the first line, i.e., the output is
apple
0
1
2
If I remove the ssh, everything works! For some reason, the ssh messes up the whole thing, and exits the while loop. I have absolutely no idea why that is!!