I want to list the files on the remote machine using bash script without entering password.
I am using following command to do it
sshpass -p password ssh user@ubuntusite.net "ls /usr/local/"
I want to get the exit code from the above command to know my command (ls /usr/local) fails or get passed.
How to do it? Kindly help me