Path: utzoo!utstat!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!olivey!jerry From: jerry@olivey.olivetti.com (Jerry Aguirre) Newsgroups: news.software.b Subject: Re: problems with responses from utstat!c-news Message-ID: <49653@olivea.atc.olivetti.com> Date: 23 Oct 90 18:44:29 GMT References: <1990Oct20.234846.3679@zoo.toronto.edu> <1990Oct21.090928.10961@utstat.uucp> Sender: news@olivea.atc.olivetti.com Organization: Olivetti ATC; Cupertino, CA Lines: 20 In article <1990Oct21.090928.10961@utstat.uucp> geoff@utstat.uucp (Geoff Collyer) writes: > rsh foo "exit 1" > >(for example) returns an exit status of 0 (at least in both directions >between SunOS 3.5 and Irix 3.2). This is a bug, and I intend to take I have run into this one before. It was certainly not the behavior I expected. The rsh command returns the exit status of the rsh itself, not the status of the remote command. So if the network or other system is unreachable then the status is usable but if the remote command fails then the script will proceede along untroubled by the failure. My work around is to use: rsh foo "rmtcommand && echo RSH_OK" | grep -s "RSH_OK" The rsh|grep pipeline returns the status of the grep command and it is true if the remote command is true. Jerry