I want to connect to multiple machines specified in a file and perform 'ls' there.
That's what I've come up with:
for machine in $(cat machines) do echo "Connecting to " $machine ssh $machine ls -la && exit done
Apart from the fact that I need to 'cd' to a different directory before the 'ls', the loop ends after the first entry in the file. This first entry is my machine itself, if that is important.
What am I missing?