Remote shell question

Eric Gisin eric at mks.mks.com
Thu Feb 7 13:21:44 AEST 1991


>+---------------
>| 	remsh/rsh remote-host 'sleep 30 <&- >&- 2>&- 7>&- &'
>| 
>| The offending fd #7 showed up in a "/etc/pstat -u pid-of-sleep-process" in
>| the file section.
>+---------------
>*7* ????!  Was ist los?

This is a rshd bug. Csh seems to close fd 3-9 at some point.
This bug causes lots of wasted time when trying to write an xrsh
shell script for X11.  You try
	rsh host "DISPLAY=$DISPLAY $@ 0<>/dev/null 1<&0 2<&0 &"
but the rsh doesn't exit after starting the remote command.
You have to close fd 0-2 otherwise rshd will wait for them to be closed
by the background command ($@ &). But the socket has been dup'd to 6 or 7,
so you have to use
	rsh host "exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-; DISPLAY=..."



More information about the Comp.unix.shell mailing list