Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!orstcs!uther.CS.ORST.EDU!pvo From: pvo@uther.CS.ORST.EDU (Paul V O'Neill) Newsgroups: comp.unix.questions Subject: Re: Help with RSH error status return Message-ID: <11663@orstcs.CS.ORST.EDU> Date: 15 Jul 89 03:30:55 GMT References: <201@camdev.UUCP> Sender: usenet@orstcs.CS.ORST.EDU Reply-To: pvo@oce.orst.edu (Paul V O'Neill) Distribution: usa Organization: Oregon State Univ. - Oceanography Lines: 32 In article <201@camdev.UUCP> sscott@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@oce.orst.edu Coastal Imaging Lab OSU--Oceanography Corvallis, OR 97331 503-737-3251