comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: ACCESS TO SYSTEM VARIABLES
Date: Mon, 7 Mar 2011 07:32:13 -0800 (PST)
Date: 2011-03-07T07:32:13-08:00	[thread overview]
Message-ID: <8da3e812-ba9a-4b2b-adcf-8c156851e5de@a21g2000prj.googlegroups.com> (raw)
In-Reply-To: 4d74c5c3$0$6878$9b4e6d93@newsspool2.arcor-online.net

On Mar 7, 3:47 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> 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

That's if you're using bash.  In csh

  set LINES=42

will not make the variable LINES available in the environment, but
this will:

  setenv LINES 42

                         -- Adam



  reply	other threads:[~2011-03-07 15:32 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
2011-03-07 15:32   ` Adam Beneschan [this message]
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