Return status of 'rsh'

Patrick R. Brown pbrown at vtopus.cs.vt.edu
Wed Apr 10 04:49:35 AEST 1991


I am trying to set up a shell script to check for mail on a remote
machine.  The script is the following:

	#! /bin/sh
	#
	#	Check mail on CSGrad since I can't get mail here!!!!
	#
	if [ `rsh csgrad mail -e` ]
	then
		echo You have mail on CSGrad.
	else
		echo You do not have mail on CSGrad.
	fi

This looks nice, but it doesn't work.  (I never "have" mail, even when
I do) What can I do (if anything) to get 'rsh' to return the status of
the command being run remotely.  The Ultrix man pages don't have
anything to say on this topic.  If 'rsh' won't do this, are there any
other ideas?

Thanks in advance,
Pat
--
Patrick R. Brown                 __    _________
email: pbrown at csgrad.cs.vt.edu   \ \  / ___  __/  Virginia Tech:
smail: 375 New Kent Rd.           \ \/ /  / /     "Po but Proud"
       Blacksburg, VA  24060       \__/  /_/      (703) 552-4016



More information about the Comp.unix.questions mailing list