comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Accessing Shell Variables
Date: Wed, 28 Dec 2016 20:51:20 +0000
Date: 2016-12-28T20:51:20+00:00	[thread overview]
Message-ID: <lyr34rydyv.fsf@pushface.org> (raw)
In-Reply-To: o414s0$1k8g$1@gioia.aioe.org

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.


  reply	other threads:[~2016-12-28 20:51 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 [this message]
2016-12-28 21:38     ` Victor Porton
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