2 # This script takes no arguments.
4 if test "$VERBOSE" = yes; then
9 # Setting this envvar to a very small value used to cause e.g., `stty size'
10 # to generate slightly different output on certain systems.
14 # Make sure we get English-language behavior.
15 # See the report about a possibly-related Solaris problem by Alexandre Peshansky
16 # <http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00035.html>.
17 # Currently stty isn't localized, but it might be in the future.
21 # Make sure there's a tty on stdin.
22 . $srcdir/../input-tty
24 # Versions of GNU stty from shellutils-1.9.2c and earlier failed
25 # tests #2 and #4 when run on SunOS 4.1.3.
28 1 rows_40_columns_80 40_80
29 2 rows_1_columns_1 1_1
30 3 rows_40_columns_80 40_80
41 saved_size=.saved-size
43 stty size > $saved_size \
44 || { echo "$0: skipping this test: can't get window size" 1>&2;
51 expected_result="`echo $3|tr _ ' '`"
52 test "$args" = empty && args=''
53 test "x$args" = xLAST && break
54 args=`echo x$args|tr _ ' '|sed 's/^x//'`
55 if test "$VERBOSE" = yes; then
56 # echo "testing \`stty $args; stty size\` = $expected_result ..."
57 echo "test $test_name... " | tr -d '\n'
60 test x"`stty size 2> /dev/null`" = "x$expected_result" \
61 && ok=ok || ok=FAIL fail=1
62 test "$VERBOSE" = yes && echo $ok
66 stty `cat $saved_size|sed 's/ / columns /;s/^/rows /'` || exit 1