Fix error with stty command in shell scripts
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Aug 2014 04:32:17 +0000 (00:32 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 16 Aug 2014 00:43:53 +0000 (20:43 -0400)
command:
    stty size

Error message:
    stty: standard input: Inappropriate ioctl for device

stage1/bootscripts/functions

index 4a436e0..90d0c03 100644 (file)
@@ -14,7 +14,7 @@ export PATH="/tools/bin:/tools/sbin:/bin:/sbin"
 ## Screen Dimensions
 # Find current screen size
 if [ -z "${COLUMNS}" ]; then
-    COLUMNS=$(stty size)
+    COLUMNS=$(stty size < /dev/console)
     COLUMNS=${COLUMNS##* }
 fi