[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Environmental variables in Ruby 1.8.5

Chris Gehlker

8/28/2006 4:52:00 PM

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)




2 Answers

Kent Sibilev

8/28/2006 5:15:00 PM

0

$ 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.dat...

Chris Gehlker

8/28/2006 5:29:00 PM

0

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

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


Thanks Kent,
I get it now.

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