Help with RSH error status return

Paul V O'Neill pvo at uther.CS.ORST.EDU
Sat Jul 15 13:30:55 AEST 1989


In article <201 at camdev.UUCP> sscott at camdev.UUCP (Steve Scott) writes:
>
>           But what I WANT to do is to have 
>
>           rsh B dumb_script
>
>have a return error status equal to the return error status
>of the program which ran on machine B  ........

Welllll..... this isn't exactly the answer you requested, BUT, since noone
can come up with how to do it w/ sh, here's how to do it w/ csh.


#!/bin/csh
cd /your/favorite/directory
if ( -f testlogin ) \rm testlogin
if ( -f teststatus ) \rm teststatus

(rsh B dumb_script >& teststatus) >& testlogin
............

You may now test the file teststatus for any output from dumb_script
and test the file testlogin for any login error messages.  Of course, if
dumb_script is a csh script whose last line is "echo $status", well,
there you are.



Paul O'Neill                 pvo at oce.orst.edu
Coastal Imaging Lab
OSU--Oceanography
Corvallis, OR  97331         503-737-3251



More information about the Comp.unix.questions mailing list