Re: Antwort: Re: rsh and return code

From: John Dunn (john.dunn@SEFAS.CO.UK)
Date: Wed Nov 06 2002 - 10:40:06 EST


I use the following code. Ot either returns 1 0r 0

HOST=$1
shift
COMMAND=$*

REMOTESTATUS=`rsh $HOST -l myuser "$COMMAND || echo 1"`
STATUS=$?
if [ $STATUS -ne 0 ]
then
    REMOTESTATUS=1
fi
if [ -z "$REMOTESTATUS" ]
   then
     REMOTESTATUS=0
fi
exit $REMOTESTATUS

John

-----Original Message-----
From: Hernan Schiavi [mailto:hschiavi@TA.TELECOM.COM.AR]
Sent: 06 November 2002 15:17
To: aix-l@Princeton.EDU
Subject: Re: Antwort: Re: rsh and return code

Try this:

rsh styx '(dddddd;echo $?)'

This might work.

Saludos.
Hernan.

Por favor, responda a IBM AIX Discussion List <aix-l@Princeton.EDU>

Enviado por: IBM AIX Discussion List <aix-l@Princeton.EDU>

Destinatarios: aix-l@Princeton.EDU
CC:

Asunto: Antwort: Re: rsh and return code
Clasificación:

Hi,
      thanks for your answer, but this don't work.

script (date_tool):

# cat date_tool

#!/bin/ksh
rsh styx kjfdhkjashf

execute:

# ./date_tool
ksh: kjfdhkjashf: not found.
(root:hermes)[/tmp]
# echo $?
0
(root:hermes)[/tmp]

Frank Mueller

############################################################################
####################

I don't think that you can do this. $? isn't available through rsh/dsh.

You could write a simple script to run your command then echo the return
code.

Simon Green
Philip Morris ITSC Europe

http://www.telecom.com.ar



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:18 EDT