Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
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...