This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: "LINES" environment variable

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 [] 
Sent: Monday, 11 February 2002 7 39
To: Stephano Mariani; 'Scott Prive'
Subject: RE: "LINES" environment variable
Importance: High


The result of these commands ...

         % strings /bin/bash.exe |egrep LINES


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

... show three occurrences of LINES built into BASH and "less" lets you
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
as exported environment variables) based on what the tty driver reports
the terminal window dimensions. From what you say, the fact that LINES
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,
set the variable manually in whatever script you're running or supply
value as an argument, possibly via an -option. You could always just
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
>using bash easily, but what about ash (/bin/sh) or any other cygwin 
>program (perhaps ones started outside of bash).
>Stephano Mariani
>-----Original Message-----
>From: Scott Prive []
>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
>mind it being picked up for everything you might run from the shell).
>-----Original Message-----
>From: Stephano Mariani []
>Sent: Thursday, February 07, 2002 6:39 PM
>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
>says 25.
>Stephano Mariani

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]