From: Aidan Kehoe (kehoea at domain parhasard.net)
Date: Tue 04 Jun 2002 - 19:46:54 IST
Ar an 4u la de mi 6, scriobh Niall O Broin :
> COLUMNS was set automatically on login from my terminal dimensions. So how
> does one explain the behaviour above ?
Shell variable vs. environment variable. The second is passed on to
subprocesses, while the first isn't. That's why you have to 'export'
anything you want to put in the environment. Cf.
$ echo $BASH_VERSION
2.03.0(1)-release
$ cat thing.sh
#!/bin/sh
echo COLUMNS is $COLUMNS
$ ./thing.sh
COLUMNS is
$ echo $COLUMNS
80
$
-- I'm not a pheasant plucker / I'm a pheasant plucker's son. I'm just a'plucking pheasants / 'Til the pheasant plucker comes.
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:17:05 GMT