Operating System - Linux
1752299 Members
4855 Online
108786 Solutions
New Discussion

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 1
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...