mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
An even nicer smart COL and WCOL bit :-)
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@814 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
17b8576a41
commit
cccc5902e1
@ -27,8 +27,11 @@ the following command:
|
|||||||
if [ -z "$COLUMNS" ]
|
if [ -z "$COLUMNS" ]
|
||||||
then
|
then
|
||||||
# Get the console device if we don't have it already
|
# Get the console device if we don't have it already
|
||||||
test -z "$CONSOLE" && CONSOLE=/dev/console
|
# This is ok by the FHS as there is a fallback if
|
||||||
|
# /usr/bin/tty isn't available, for example at bootup.
|
||||||
|
test -x /usr/bin/tty && CONSOLE=`/usr/bin/tty`
|
||||||
|
test -z "$CONSOLE" && CONSOLE=/dev/console
|
||||||
|
|
||||||
# Get the console size (rows columns)
|
# Get the console size (rows columns)
|
||||||
SIZE=$(stty size < $CONSOLE)
|
SIZE=$(stty size < $CONSOLE)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user