On Thursday 03 March 2005 16:57, Yves Rutschle wrote:
That's right, COLUMNS is actually a bash variable, and is
not normally part of the environment. You can get it from
the output of resize(1) though:
Great idea, thank you! :-) Why didn't I think about that before? A simple
command which prints them out...
...But resize is part of X (even if it doesn't use xlibs), and we don't want
to depend on xutils for that...
...Here comes tput: simply using
$columns = (`tput cols`);
print $columns;
will solve all of our problems, and tput is part of ncurses-bin (essential
package), so no additional dependencies are introduced.
Thank you again,
Danilo