Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41213 - bash profile (skel) should export more things by default like COLUMNS and LINES
Summary: bash profile (skel) should export more things by default like COLUMNS and LINES
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 41166
  Show dependency tree
 
Reported: 2004-02-11 01:16 UTC by Aaron Peterson
Modified: 2004-02-11 21:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Peterson 2004-02-11 01:16:58 UTC
I've been trying to figure out how to make this simple shell script work:
#!/bin/bash
echo $COLUMNS

apperantly, the way to do this is to say COLUMNS=$COLUMNS cow.sh
or export $COLUMNS  cow.sh

but the other way is it have these imporant enviorment variables exported by default

Reproducible: Didn't try
Steps to Reproduce:
1.
2.
3.
Comment 1 SpanKY gentoo-dev 2004-02-11 18:29:19 UTC
i dont have COLUMNS defined anywhere in my files yet that var works when i start a new bash

what shell do you use ?
Comment 2 Aaron Peterson 2004-02-11 21:44:10 UTC
bash-2.05b$ whoami
aaron
bash-2.05b$ bash --version
GNU bash, version 2.05b.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.
bash-2.05b$ cat cow2.sh
#!/bin/bash
#shopt -s checkwinsize
#kill -n 28 $$
echo $COLUMNS
bash-2.05b$ ./cow2.sh

bash-2.05b$ . cow2.sh
71
bash-2.05b$ COLUMNS=$COLUMNS ./cow2.sh
71
bash-2.05b$
Comment 3 SpanKY gentoo-dev 2004-02-11 21:54:40 UTC
from bash(1):
       COLUMNS
              Used by the select builtin command  to  determine  the  terminal
              width  when  printing  selection  lists.  Automatically set upon
              receipt of a SIGWINCH.
from signals(7):
       SIGWINCH    28,28,20    Ign     Window resize signal (4.3 BSD, Sun)

if you want access to that kind of information in scripts i'd suggest you utilize `stty size`