Shell Loop Terminating After Command

[Solved] Shell Loop Terminating After Command | Perl - Code Explorer | yomemimo.com
Question : shell loop terminating after command

Answered by : good-gorilla-2i6mccc31s71

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.

Source : | Last Update : Mon, 27 Apr 20

Answers related to shell loop terminating after command

Code Explorer Popular Question For Perl