aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/functions.xml
diff options
context:
space:
mode:
authorMark Hymers <markh@linuxfromscratch.org>2001-07-19 23:51:20 +0000
committerMark Hymers <markh@linuxfromscratch.org>2001-07-19 23:51:20 +0000
commitcccc5902e13126d87ede30dba5dac51c760bd28d (patch)
tree0fe7815b70b4b5bb2b82427b29d50eb8f88321a6 /chapter07/functions.xml
parent17b8576a41c8b378276448f7792119ebc5efd033 (diff)
An even nicer smart COL and WCOL bit :-)
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@814 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07/functions.xml')
-rw-r--r--chapter07/functions.xml7
1 files changed, 5 insertions, 2 deletions
diff --git a/chapter07/functions.xml b/chapter07/functions.xml
index 15bda9133..748be6fd7 100644
--- a/chapter07/functions.xml
+++ b/chapter07/functions.xml
@@ -27,8 +27,11 @@ the following command:
if [ -z "$COLUMNS" ]
then
# Get the console device if we don't have it already
- test -z "$CONSOLE" &amp;&amp; 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)
SIZE=$(stty size &lt; $CONSOLE)