I need to perform an operation on a list of server, through SSH.
I am using sshpass, and that operation might fail, however it's supposed to happen a few time, and the script should still continue.
#!/bin/bash while read address; do echo -n "$address " sshpass -p password ssh -o StrictHostKeyChecking=no user@$address 'ls /path/to/some/dir' done < address-list
However, the command ran through ssh fail on the first host, and the script immediately exit.
How can I have the loop continue executing, no matter what ? Adding an exit after my command doesn't fix this, and unsetting exit on error
set +e doesn't work either.