comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Accessing Shell Variables
Date: Wed, 28 Dec 2016 23:38:41 +0200
Date: 2016-12-28T23:38:41+02:00	[thread overview]
Message-ID: <o41bcv$1uu1$1@gioia.aioe.org> (raw)
In-Reply-To: lyr34rydyv.fsf@pushface.org

Simon Wright wrote:

> Victor Porton <porton@narod.ru> writes:
> 
>> ahlan.marriott@gmail.com wrote:
>>
>>> I can access Windows, Linux and Osx environment variables using
>>> Ada.Environment_Variables.Value However Linux and Osx also have Shell
>>> variables. How can I access these?
>>
>> You cannot access a shell variable unless it is exported. Exported shell
>> variable becomes and environment variable:
>>
>> xxx=yyy
>> ./my-program  # my-program cannot (at least in an easy way) access $xxx
>>
>> export xxx=yyy
>> # or
>> xxx=yyy
>> export xxx
>> ./my-program  # my-program cannot access xxx environment variable
> 
> This variant is the one that *can* access the environment variable.

Yes, my typo.

-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2016-12-28 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 18:19 Accessing Shell Variables ahlan.marriott
2016-12-28 19:47 ` Victor Porton
2016-12-28 20:51   ` Simon Wright
2016-12-28 21:38     ` Victor Porton [this message]
2016-12-29  9:42       ` ahlan.marriott
2016-12-28 19:50 ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox