Return status of 'rsh'

Stephen Harris sweh at tharr.UUCP
Thu Apr 11 03:45:42 AEST 1991


In article <PBROWN.91Apr9194949 at vtopus.cs.vt.edu} pbrown at vtopus.cs.vt.edu (Patrick R. Brown) writes:
}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 'spose you could try something line
	#!/bin/sh
	#
	rsh csgrad "mail -e && echo You have mail on CSGrad || echo You do not have mail on CSGrad"

NOTE: this hasn't been tried by me (inappropriate machine setup :-) ) but
it should work - just get all the processing and output done on CSGrad.

Hope this helps



-- 
    			     Stephen Harris
Disclaimer: me have an opinion?     | Email: ..!ukc!axion!tharr!sweh
            What an idea!	    |        sweh%tharr.uucp at uk.co.bt.axion
Wanted: humour transplant           |        tharr!sweh at uk.ac.ukc 
     <-- tharr *free* public access to Usenet in the UK 0234 720202 -->



More information about the Comp.unix.questions mailing list