[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Setting Environmental Variables in Ruby script

jackster the jackle

10/15/2008 5:06:00 PM

I have a scipt that executes a shell command that requires my
environment to be set so the script fails. Is there a way to add my
profile settings into my ruby script?

Thanks

jack
--
Posted via http://www.ruby-....

3 Answers

Sebastian Hungerecker

10/15/2008 5:14:00 PM

0

jackster the jackle wrote:
> I have a scipt that executes a shell command that requires my
> environment to be set so the script fails. Is there a way to add my
> profile settings into my ruby script?

ENV["varname"] = "value"

HTH,
Sebastian
--
Jabber: sepp2k@jabber.org
ICQ: 205544826

ara.t.howard

10/15/2008 5:28:00 PM

0


On Oct 15, 2008, at 11:06 AM, jackster the jackle wrote:

> I have a scipt that executes a shell command that requires my
> environment to be set so the script fails. Is there a way to add my
> profile settings into my ruby script?
>
> Thanks
>
> jack
> --
> Posted via http://www.ruby-....
>


cfp:~ > cat this-is-a-bash-question.sh
#! /bin/bash --login

echo $FOO



cfp:~ > ./this-is-a-bash-question.sh

(nothing)



cfp:~ > grep FOO .bash_profile

(nothing)


cfp:~ > echo 'export FOO=42' >> .bash_profile



cfp:~ > ./this-is-a-bash-question.sh
42


a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




jackster the jackle

10/15/2008 5:54:00 PM

0

Sebastian Hungerecker wrote:
> jackster the jackle wrote:
>> I have a scipt that executes a shell command that requires my
>> environment to be set so the script fails. Is there a way to add my
>> profile settings into my ruby script?
>
> ENV["varname"] = "value"
>
> HTH,
> Sebastian

Thanks Sebastian...my ruby script takes all the variables without error
but my script still fails so I must be missing something in my
environment still. I'll have to do some more checking....thanks again

jack

--
Posted via http://www.ruby-....