I have the following little bit of bash which appears to be working, the first ip address in the file is echoed and then I get 'hello' echoed from the ssh command. But that's it, it doesn't iterate the file.
If I take out the ssh it does. So I'm guessing its something to do with a new wheel being opened, then when it closes the loop gets cut. Could someone please explain why this happens and what I need to do to get the loop running?
Many thanks.
Code: Select all
while read line; do
echo $line
ssh pi@$line echo hello
done </mybin/nodes