Handle cases with stty not returning anything
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 28 Jul 2010 14:11:07 +0000 (14:11 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 28 Jul 2010 14:11:07 +0000 (14:11 +0000)
org.glite.testsuites.ctb/LB/tests/lb-common.sh
org.glite.testsuites.ctb/LB/tests/test-common.sh

index 13ffb8d..d3feaf2 100755 (executable)
@@ -109,6 +109,7 @@ SYS_TAIL=tail
 SYS_DATE=date
 SYS_EXPR=expr
 SYS_BC=bc
+SYS_SCP=bc
 
 # not used at the moment
 DEBUG=2
index f0ca470..fe64166 100644 (file)
@@ -50,8 +50,13 @@ export LC_ALL
 # Seek for terminal size and, if needed, set default size
 if [ -z "${LINES}" -o -z "${COLUMNS}" ]; then
        stty_size=`stty size`
-       LINES=`echo ${stty_size} | awk '{print $1}'`
-       COLUMNS=`echo ${stty_size} | awk '{print $2}'`
+       if [ $? = 0 ]; then  
+               LINES=`echo ${stty_size} | awk '{print $1}'`
+               COLUMNS=`echo ${stty_size} | awk '{print $2}'`
+       else
+               LINES=24
+               COLUMNS=80
+       fi
 fi
 if [ ! $LINES -ge 0 ]; then LINES=24; fi
 if [ ! $COLUMNS -ge 0 ]; then COLUMNS=80; fi