Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!sgi!shinobu!odin!thestepchild!rhartman From: rhartman@thestepchild.sgi.com (Robert Hartman) Newsgroups: comp.unix.shell Subject: passing envars to remote shell (was: rsh guru ...) Keywords: rsh Message-ID: <1991Apr23.181416.22049@odin.corp.sgi.com> Date: 23 Apr 91 18:14:16 GMT References: <6226@iron6.UUCP> <1991Apr23.003518.4442@leland.Stanford.EDU> Sender: news@odin.corp.sgi.com (Net News) Distribution: comp.unix.shell Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 25 In article <1991Apr23.003518.4442@leland.Stanford.EDU> dkeisen@leland.Stanford.EDU (Dave Eisen) writes: >In article <6226@iron6.UUCP> yeates@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