Mailinglist Archive: opensuse (1696 mails)

< Previous Next >
Re: [opensuse] BASH: has $COLUMNS gone nuts?
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Thu, 23 Jul 2009 22:01:26 -0500
  • Message-id: <200907232201.27203.drankinatty@xxxxxxxxxxxxxxxxxx>
On Thursday 23 July 2009 09:43:12 pm David C. Rankin wrote:
On Thursday 23 July 2009 09:22:34 pm David C. Rankin wrote:
Listmates,

Here is one I'm having difficulty understanding. As part of your
environment the "LINES" and "COLUMNS" variables are defined telling you the
number of lines and columns an xterm has. Many old script examples make use
of them. Now, I can't make use of them? Specifically, from the command line:

echo $COLUMNS

properly returns the number of columns for the terminal. But calling or
assigning $COLUMNS in a script no longer works. Try this in a bash script:

#!/bin/bash
echo $COLUMNS
exit 0

Nothing?? Why?



OK,

When did "LINES" and "COLUMNS" stop being exported?



Hmm:

[21:58 alchemy:/home/david] # grep COLUMNS /etc/*
/etc/profile: export LINES COLUMNS TERM

Has the something with the shell changed that makes the export no
longer available to scripts? Shell type? (login, etc..)

--
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups