How to capture all the environment variables from shell?

Cameron Simpson cs at zip.com.au
Wed Aug 11 05:16:01 CEST 2010


On 11Aug2010 13:08, I wrote:
| On 10Aug2010 10:07, Steven W. Orr <steveo at syslang.net> wrote:
[...]
| | After that, and again, be aware that the .bashrc alone is executed for login
| | shells *which are not interactive*. for example:
| | 
| | ssh somemachine 'echo Hello'
| | 
| | This command will *not*  go through the .bash_profile but it will go through the
| | .bashrc.
| 
| No, only interactive shells use the .bashrc.

And then I read more closely and saw this in "man bash":

  Bash attempts to determine when it is being run  by  the  remote shell
  daemon,  usually  rshd.  If bash determines it is being run by rshd,
  it reads and executes commands from ~/.bashrc, if that file exists and
  is readable.  It will not do this if invoked as sh.  The --norc option
  may be used to inhibit this behavior, and the --rcfile option may  be
  used to  force  another  file to be read, but rshd does not generally
  invoke the shell with those options or allow them to be specified.

Frankly, bash's startup behaviour is so corrupt (well, capricious anway)
that I despair of it; I use zsh when possible. It also tries to be all
things to all people, but is a bit saner. (And it doesn't hardwire ^W
either!)

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

To be positive: To be mistaken at the top of one's voice.
Ambrose Bierce (1842-1914), U.S. author. The Devil's Dictionary (1881-1906).



More information about the Python-list mailing list