Path: utzoo!attcan!uunet!husc6!uwvax!dave@cs.wisc.edu From: dave@cs.wisc.edu (Dave Cohrs) Newsgroups: comp.unix.wizards Subject: Re: rsh environment Keywords: no /etc/profile sourced? Message-ID: <6928@spool.cs.wisc.edu> Date: 22 Dec 88 20:47:34 GMT References: <1276@uwbull.uwbln.UUCP> Sender: news@spool.cs.wisc.edu Reply-To: dave@cs.wisc.edu (Dave Cohrs) Organization: U of Wisconsin CS Dept Lines: 35 > Is there any way to alter the default environment setting used when > rsh (the bsd remote shell) executes commands? Are you *sure* you're using the BSD rsh (don't forget about the rshd on the remote side), and not some Wollongong hacked up version that runs on a SysV machine? Seeing that LOGNAME in your environment leads me to wonder... The rsh I use between two real BSD systems gives me an environment with HOME, SHELL, PATH, and USER, and, because I use /bin/csh for a shell, runs my .cshrc, which sets whatever other environment variables I want. SysV's /bin/sh only runs your /etc/profile or your own .profile when you log in, and a remote shell is not the same thing as logging in. I guess if the remote machine is not a real BSD machine, or your shell is csh, you can't easily change your environment. You can, of course rsh a command like (assume your remote shell is /bin/sh or ksh): rsh somemachine "FOO=$FOO command args" and set one or more remote envariables to be the same as they were on your local shell (assuming you had a envariable FOO in your local shell). The variations on this theme are endless. You can also: rsh somemachine ". .profile ; command args" There are no provisions in the rsh protocol to automatically copy your environment to the remote shell. dave cohrs -- Dave Cohrs +1 608 262-6617 UW-Madison Computer Sciences Department dave@cs.wisc.edu ...!{harvard,rutgers,ucbvax}!uwvax!dave