Environmental variables in Ruby 1.8.5

I get:
irb(main):001:0> ENV.keys.size
=> 15
irb(main):002:0> ENV.keys[0..14]
=> ["TERM_PROGRAM", "TERM", "SHELL", "CLICOLOR", "TERM_PROGRAM_VERSION", "USER", "__CF_USER_TEXT_ENCODING", "PATH", "RI", "PWD", "SHLVL", "HOME", "LOGNAME", "SECURITYSESSIONID", "_"]

Which is a smaller set of environmental variables quite different than what is described in the Pickaxe Book. Did the Ruby powers trim them? Just curious.

···

--
Conscience is thoroughly well-bred and soon leaves off talking to those who do not wish to hear it.
-Samuel Butler, writer (1835-1902)

$ env | wc -l
      23
$ ruby -e 'puts ENV.size'
23

···

On 8/28/06, Chris Gehlker <canyonrat@mac.com> wrote:

I get:
irb(main):001:0> ENV.keys.size
=> 15
irb(main):002:0> ENV.keys[0..14]
=> ["TERM_PROGRAM", "TERM", "SHELL", "CLICOLOR",
"TERM_PROGRAM_VERSION", "USER", "__CF_USER_TEXT_ENCODING", "PATH",
"RI", "PWD", "SHLVL", "HOME", "LOGNAME", "SECURITYSESSIONID", "_"]

Which is a smaller set of environmental variables quite different
than what is described in the Pickaxe Book. Did the Ruby powers trim
them? Just curious.

--
Conscience is thoroughly well-bred and soon leaves off talking to
those who do not wish to hear it.
-Samuel Butler, writer (1835-1902)

--
Kent
---
http://www.datanoise.com

It is *your* environment ruby is seeing

may I demonstrate

robert@PC:~/mirrors 19:22:04
255/36 > ruby -e 'p ENV["xxx"]'
nil
robert@PC:~/mirrors 19:22:28
256/37 > xxx="set now" ruby -e 'p ENV["xxx"]'
"set now"
robert@PC:~/mirrors 19:22:44

Hope that helps
Robert

Thanks Kent,
I get it now.

···

On Aug 28, 2006, at 10:14 AM, Kent Sibilev wrote:

$ env | wc -l
     23
$ ruby -e 'puts ENV.size'
23

--
Conscience is thoroughly well-bred and soon leaves off talking to those who do not wish to hear it.
-Samuel Butler, writer (1835-1902)

Ah I see Kent, that was a very clever and concise way to show your point.
So clever I failed to see it :frowning:

Cheers
Robert

···

On 8/28/06, Kent Sibilev <ksruby@gmail.com> wrote:

$ env | wc -l
      23
$ ruby -e 'puts ENV.size'
23

On 8/28/06, Chris Gehlker <canyonrat@mac.com> wrote:
> I get:
> irb(main):001:0> ENV.keys.size
> => 15
> irb(main):002:0> ENV.keys[0..14]
> => ["TERM_PROGRAM", "TERM", "SHELL", "CLICOLOR",
> "TERM_PROGRAM_VERSION", "USER", "__CF_USER_TEXT_ENCODING", "PATH",
> "RI", "PWD", "SHLVL", "HOME", "LOGNAME", "SECURITYSESSIONID", "_"]
>
> Which is a smaller set of environmental variables quite different
> than what is described in the Pickaxe Book. Did the Ruby powers trim
> them? Just curious.
>
> --
> Conscience is thoroughly well-bred and soon leaves off talking to
> those who do not wish to hear it.
> -Samuel Butler, writer (1835-1902)
>

--
Kent
---
http://www.datanoise.com

--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.

- Albert Einstein