[lug] Python environment variable question
Daniel Webb
lists at danielwebb.us
Fri Mar 17 20:47:28 MST 2006
bash$ echo $HOSTNAME
ani
bash$ python
Python 2.3.5 (#2, Sep 4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ
{'TERM': 'xterm', 'SHELL': '/bin/bash', 'TZ': 'America/Denver', 'SHLVL': '1',
'SSH_TTY': '/dev/pts/3', 'OLDPWD': '/root/scripts/sbs/firewall', 'RSYNC_RSH':
'ssh', 'PWD': '/root/scripts/sbs', 'LESSOPEN': '|lesspipe.sh %s',
'SHORT_HOSTNAME': 'ani', 'SSH_CLIENT': '::ffff:192.168.0.100 41527 22',
'CVS_RSH': 'ssh', 'LOGNAME': 'root', 'USER': 'root', 'PATH':
'/bin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/root/scripts/bin:/root/projects/ctools/extract',
'MAIL': '/var/mail/root', 'BASH_ENV': '/root/.bashrc', 'SSH_CONNECTION':
'::ffff:192.168.0.100 41527 ::ffff:192.168.0.109 22', 'HOME': '/root', '_':
'/usr/bin/python', 'EDITOR': 'vi'}
Notice no HOSTNAME, even though there is a variable I set in my .bashrc
called SHORT_HOSTNAME.
Why?
More information about the LUG
mailing list