📜  shell 循环在命令后终止 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:32.636000             🧑  作者: Mango

代码示例1
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.