Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote Shell - return codes

Status
Not open for further replies.

aixTim

MIS
Jun 19, 2002
32
NL
I'm looking for a way of extracting the return code of the command run on a remote system using rsh.

$? gives me the return code from the rsh command itself.

tia

 
hi,
if you have access to the targer system, try by

create an executable script as


/usr/local/launcher
-------------------
#!/usr/bin/ksh
$*
echo $?
exit 0


then, from the "client" system run

rsh targethost /usr/local/launcher "my command"

on output you'll see ouput of command (discard it)
and on last line return code of your command

If you want, may modify script as
echo $? > /dev/null 2>&1

or two versions .


try & by
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top