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-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!2a02:590:1:1::196.MISMATCH!news.teledata-fn.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 07 Mar 2011 12:47:14 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ACCESS TO SYSTEM VARIABLES References: <31c9ef20-db49-4d3e-bafb-0d2a5dca7866@e9g2000vbk.googlegroups.com> In-Reply-To: <31c9ef20-db49-4d3e-bafb-0d2a5dca7866@e9g2000vbk.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4d74c5c3$0$6878$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Mar 2011 12:47:15 CET NNTP-Posting-Host: 83c3d460.newsspool2.arcor-online.net X-Trace: DXC=k5IBbSP@hRcFXUDVUnEXQmA9EHlD;3Ycb4Fo<]lROoRa8kFjLh>_cHTX3jm<`@>Dg^Y 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