From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: ACCESS TO SYSTEM VARIABLES
Date: Mon, 07 Mar 2011 12:47:14 +0100
Date: 2011-03-07T12:47:15+01:00 [thread overview]
Message-ID: <4d74c5c3$0$6878$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <31c9ef20-db49-4d3e-bafb-0d2a5dca7866@e9g2000vbk.googlegroups.com>
On 07.03.11 10:34, Emile8 wrote:
> with Ada.Environment_Variables; use Ada.Environment_Variables;
> with Ada.Text_Io; use Ada.Text_Io;
>
> procedure Print_Env is
> begin
> Put_Line("Columns : " & Value("COLUMNS"));
> Put_Line("Lines : " & Value("LINES"));
> Put_Line("Path : " & Value("PATH"));
> end Print_Env;
>
>
> I would like to understand the reasons of this behavior. Are there
> different kinds of system variables in Linux ? Those as HOME, PATH
> whose values depend only on the user session and those as LINES,
> COLUMNS defined for each used terminal. Is there a way in Ada to
> overcome this limitation ?
Variables LINES and COLUMNS might not have been marked for export.
Try export -p.
With the above program, I see constraint errors for LINES and
COLUMNS when these don't exist in the environment (which is
expected behavior).
$ LINES=$LINES COLUMNS=$COLUMNS ./print_env
Columns : 255
Lines : 42
Path : /usr/local/bin:/usr/bin:/bin:/usr/games
next prev parent reply other threads:[~2011-03-07 11:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-07 9:34 ACCESS TO SYSTEM VARIABLES Emile8
2011-03-07 11:47 ` Georg Bauhaus [this message]
2011-03-07 15:32 ` Adam Beneschan
2011-03-07 20:14 ` Emile8
2011-03-07 21:32 ` Peter C. Chapin
2011-03-08 17:13 ` Emile8
2011-03-09 18:59 ` Emile8
2011-03-07 22:51 ` Keith Thompson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox