Answers for "bash break loop"

1

shell break while loop

workdone=0
while : ; do
  ...
  if [ "$workdone" -ne 0 ]; then
      break
  fi
done
Posted by: Guest on November-29-2021
0

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.
Posted by: Guest on April-20-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language