diff options
Diffstat (limited to 'chapter07/functions.xml')
-rw-r--r-- | chapter07/functions.xml | 7 |
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" && 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 < $CONSOLE) |