shell break while loop
workdone=0
while : ; do
...
if [ "$workdone" -ne 0 ]; then
break
fi
done
shell break while loop
workdone=0
while : ; do
...
if [ "$workdone" -ne 0 ]; then
break
fi
done
shell loop terminating after command
The problem is that do_work.sh runs ssh commands and by default ssh reads from stdin which is your input file. As a result, you only see the first line processed, because ssh consumes the rest of the file and your while loop terminates.
To prevent this, pass the -n option to your ssh command to make it read from /dev/null instead of stdin.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us