# Re: ENV shows partial environment only

**URL:** <https://www.ruby-forum.com/t/re-env-shows-partial-environment-only/71068>\
**Category:** Ruby\
**Created:** [October 5, 2006, 5:45am UTC](https://www.ruby-forum.com/t/re-env-shows-partial-environment-only/71068 "2006-10-05T05:45:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gennady\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c57346/32.png) [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Post date:** [October 5, 2006, 5:45am UTC](https://www.ruby-forum.com/t/re-env-shows-partial-environment-only/71068/1 "2006-10-05T05:45:47Z")

</div>

Eero S. wrote:

> 18:28:43 ruerue@yawn \> ruby -v  
> ruby 1.8.5 (2006-08-25) [amd64-freebsd6]
> 
> 18:28:51 ruerue@yawn \> set | ruby -e ‘p ARGF.readlines.map {|l|  
> l.split("=").first if l =~ /^[A-Z]/}.compact’

Command ‘set’ is a shell’s built-in, besides environment variables it  
shows also the shell’s internal ones that happened to follow the same  
syntax. Those internal ones are not inherited by a spawned process,  
unless exported, it which case that are placed in the environment. On  
the other hand, ‘env’ shows just environment variables, exactly same  
thing will show up when you do this in Ruby:

p \*ENV

Hope it helps,  
Gennady.

---

<div class="post-metadata">

**Author:** ![Gennady\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c57346/32.png) [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Post date:** [October 5, 2006, 9:00am UTC](https://www.ruby-forum.com/t/re-env-shows-partial-environment-only/71068/2 "2006-10-05T09:00:05Z")

</div>

On 2006.10.05 12:44, Gennady B. wrote:

> > An example session:  
> > unless exported, it which case that are placed in the environment. On  
> > the other hand, ‘env’ shows just environment variables, exactly same  
> > thing will show up when you do this in Ruby:
> 
> p \*ENV

Yep, clears that part, thanks–now I need to figure out WHY some things  
are not getting propagated properly 🙂

Thanks to Mike and Logan also.
