From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f9642664cfbe6417 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!a21g2000prj.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: ACCESS TO SYSTEM VARIABLES Date: Mon, 7 Mar 2011 07:32:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <8da3e812-ba9a-4b2b-adcf-8c156851e5de@a21g2000prj.googlegroups.com> References: <31c9ef20-db49-4d3e-bafb-0d2a5dca7866@e9g2000vbk.googlegroups.com> <4d74c5c3$0$6878$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1299511934 28964 127.0.0.1 (7 Mar 2011 15:32:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Mar 2011 15:32:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a21g2000prj.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17946 Date: 2011-03-07T07:32:13-08:00 List-Id: On Mar 7, 3:47=A0am, Georg Bauhaus 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=3D$LINES COLUMNS=3D$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=3D42 will not make the variable LINES available in the environment, but this will: setenv LINES 42 -- Adam