General
cancel
Showing results for 
Search instead for 
Did you mean: 

Checking the status of the script on remote machine

Rohit Khaladkar
Occasional Contributor

Checking the status of the script on remote machine

Hi!
I have a script, which calls another script on a remote machine using ssh.
I need to check if the remote running script is succesful. If it is succesful I need to continue the for loop (run it on another machine) or break the loop.

Please let me know if anyone has an idea on checking the status of the script on remote machine
1 REPLY
James R. Ferguson
Acclaimed Contributor

Re: Checking the status of the script on remote machine

Hi Rohit:

You can do something like this (by example):

# RC=$(ssh someserver 'uname -a >/tmp/output 2>&1;echo $?');echo ${RC}

You can substitute '/dev/null' for the '/tmp/output' file in this example and you can change the '-a' switch to an invalid value for proof.

Regards!

...JRF...