Subject: RE: "LINES" environment variable
From: "Stephano Mariani" <[email-masked]>
To: "'Randall R Schulz'" <[email-masked]>, "'Scott Prive'" <[email-masked]>
Cc: <[email-masked]>
Date: Mon, 11 Feb 2002 19:52:52 -0000

[...]
This setting / altering of LINES does not appear to happen when BASH is
invoked as /bin/sh.exe, so that suggests one work-around
[...]

When /bin/sh is invioked, bash does not appear to be running, on my
system, this is ash.

Of course I can find a workaround (and I have), I merely want to
discover why this behaviour occurs.

I will investigate in detail when I have more time.

Stephano Mariani

-----Original Message-----
From: Randall R Schulz [mailto:[email-masked]] 
Sent: Monday, 11 February 2002 7 39
To: Stephano Mariani; 'Scott Prive'
Cc: [email-masked]
Subject: RE: "LINES" environment variable
Importance: High

Stephano,

The result of these commands ...

         % strings /bin/bash.exe |egrep LINES

and

         % strings /bin/bash.exe |less
         [ type "/LINES<RETURN>" to search for "LINES" ]

... show three occurrences of LINES built into BASH and "less" lets you
see 
that each of these occurs in conjunction with the string COLUMNS.

So, my guess is that BASH is injecting these into the variable mix (but
not 
as exported environment variables) based on what the tty driver reports
as 
the terminal window dimensions. From what you say, the fact that LINES
is 
already set in the environment when the shell is invoked does not deter 
BASH from (re-) setting those variables.

This setting / altering of LINES does not appear to happen when BASH is 
invoked as /bin/sh.exe, so that suggests one work-around. Otherwise,
just 
set the variable manually in whatever script you're running or supply
the 
value as an argument, possibly via an -option. You could always just
choose 
a different name, too...

Randall Schulz
Mountain View, CA USA

At 11:15 2002-02-11, Stephano Mariani wrote:
>I have tried everything, but some hard-coded value must exist. The only

>way it seems to work is when I explicitly execute an export. I can do
this 
>using bash easily, but what about ash (/bin/sh) or any other cygwin 
>program (perhaps ones started outside of bash).
>
>TIA
>Stephano Mariani
>
>-----Original Message-----
>From: Scott Prive [mailto:[email-masked]]
>Sent: Monday, 11 February 2002 2 54
>To: Stephano Mariani
>Subject: RE: "LINES" environment variable
>
>I'm curious as to why Cygwin isn't pickup your NT environment variable,

>but you can export this variable from your ~/.bash_profile (if you
don't 
>mind it being picked up for everything you might run from the shell).
>
>
>-----Original Message-----
>From: Stephano Mariani [mailto:[email-masked]]
>Sent: Thursday, February 07, 2002 6:39 PM
>To: [email-masked]
>Subject: "LINES" environment variable
>Importance: High
>
>Where can I override the LINES environment variable? I need to run some

>programs that use this value to determine the display characteristics.
>
>I have set it to 50 in the system environment in windows, but echo
$LINES 
>says 25.
>
>Stephano Mariani

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/