Translations of this page:
- 日本語 (ja)
- English (en)
最近の更新
最近の更新
This will display only one line.
while read NAME HOST CMD do ssh $NAME@$HOST "$CMD" done
When you run SSH, stdin is directed at it, so the entire file is passed to SSH, not just the one line you read with read. Therefore, after executing SSH, there are no more lines to read, so the while loop will end in one go.
To prevent this, use the -n option to ssh to redirect /dev/null and not redirect stdin.