Thanks all for your replies but there's something odd. I guess I'm
still confused about how to access values from this thing that is not
quite a hash. In irb, I did as Andrei suggested and thought I saw a
HOSTNAME key, but when I try and print out the value ("puts
ENV['HOSTNAME']"), I get nil. Why does it appear when I print out the
hash but not when I try and access the value individually?
Here's the irb action:
irb(main):068:0* ENV.each { |key, value| puts "#{key} - #{value}" }
USER - myusername
LOGNAME - myusername
HOME - /home/myusername
PATH - /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/myusername/
bin
MAIL - /var/spool/mail/myusername
SHELL - /bin/zsh
SSH_CLIENT - 67.190.94.163 61497 22
SSH_CONNECTION - 67.190.94.163 61497 192.168.1.99 22
SSH_TTY - /dev/pts/1
TERM - xterm
SHLVL - 1
PWD - /usr/local/apache2/htdocs/easyrx/app/controllers
OLDPWD - /usr/local/apache2/htdocs/easyrx/app
HOSTNAME - mydomain.com
HISTSIZE - 1000
INPUTRC - /etc/inputrc
LS_COLORS -
no=00:fi=00:di=00;34:ln=00;36
i=40;33:so=00;35:bd=40;33;01:cd=40;33;01
r=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
CVS_RSH - ssh
CVSROOT - /usr/local/cvs-repository
G_BROKEN_FILENAMES - 1
SSH_ASKPASS - /usr/libexec/openssh/gnome-ssh-askpass
KDEDIR - /usr
LANG - en_US.UTF-8
LESSOPEN - |/usr/bin/lesspipe.sh %s
QTDIR - /usr/lib/qt-3.3
QTINC - /usr/lib/qt-3.3/include
QTLIB - /usr/lib/qt-3.3/lib
JAVA_HOME - /usr/lib/jdk
CATALINA_HOME - /usr/local/tomcat
_ - /usr/local/bin/irb
LINES - 46
COLUMNS - 157
=> {"USER"=>"myusername", "LOGNAME"=>"myusername", "HOME"=>"/home/
myusername", "PATH"=>"/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/
home/myusername/bin", "MAIL"=>"/var/spool/mail/myusername", "SHELL"=>"/
bin/zsh", "SSH_CLIENT"=>"67.190.94.163 61497 22",
"SSH_CONNECTION"=>"67.190.94.163 61497 192.168.1.99 22", "SSH_TTY"=>"/
dev/pts/1", "TERM"=>"xterm", "SHLVL"=>"1", "PWD"=>"/usr/local/apache2/
htdocs/easyrx/app/controllers", "OLDPWD"=>"/usr/local/apache2/htdocs/
easyrx/app", "HOSTNAME"=>"mydomain.com", "HISTSIZE"=>"1000",
"INPUTRC"=>"/etc/inputrc",
"LS_COLORS"=>"no=00:fi=00:di=00;34:ln=00;36
i=40;33:so=00;35:bd=40;33;01:cd=40;33;01
r=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:",
"CVS_RSH"=>"ssh", "CVSROOT"=>"/usr/local/cvs-repository",
"G_BROKEN_FILENAMES"=>"1", "SSH_ASKPASS"=>"/usr/libexec/openssh/gnome-
ssh-askpass", "KDEDIR"=>"/usr", "LANG"=>"en_US.UTF-8", "LESSOPEN"=>"|/
usr/bin/lesspipe.sh %s", "QTDIR"=>"/usr/lib/qt-3.3", "QTINC"=>"/usr/
lib/qt-3.3/include", "QTLIB"=>"/usr/lib/qt-3.3/lib", "JAVA_HOME"=>"/
usr/lib/jdk", "CATALINA_HOME"=>"/usr/local/tomcat", "_"=>"/usr/local/
bin/irb", "LINES"=>"46", "COLUMNS"=>"157"}