Bash script exit on command failure (sshpass)

Published: 8/01/2020
Bash script exit on command failure (sshpass)
Source: UNIX.STACKEXCHANGE.COM

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 throu

Read more
Related news
Comment
FACEBOOK