passing envars to remote shell (was: rsh guru ...)

Robert Hartman rhartman at thestepchild.sgi.com
Wed Apr 24 04:14:16 AEST 1991


In article <1991Apr23.003518.4442 at leland.Stanford.EDU> dkeisen at leland.Stanford.EDU (Dave Eisen) writes:
>In article <6226 at iron6.UUCP> yeates at motcid.UUCP (Tony J Yeates) writes:
>>"The current local environment is not passed  to  the  remote shell."
>>
>
>It isn't, and there is no real way to get around this. What I usually
>do when I want to pass something to a remote shell is to explicitly set the 
>environment variable in the command, something like (using /bin/sh as the 
>login shell):
>
>rsh silicon "VARIABLE=$VARIABLE; export VARIABLE; command-line"

Well, I suppose a person could write a wrapper for rsh that invoked it
that way:

	# ...
	# parsing routine for rsh args (e.g., -l username)
	# ...

	varnames=`printenv | sed 's/=.*//'`
	rsh $host $options; `printenv` ; export $varnames ; $command

Might be overkill though.

-r



More information about the Comp.unix.shell mailing list