From 7fda0e10653dd20394aa83acdc286fac4fff341d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 14 Aug 1999 12:42:03 +0000 Subject: [PATCH] Fail-77 if stdin is not a tty. --- tests/stty/basic-1 | 7 +++++++ tests/stty/row-col-1 | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/stty/basic-1 b/tests/stty/basic-1 index 5be8c7d..0361ba4 100755 --- a/tests/stty/basic-1 +++ b/tests/stty/basic-1 @@ -6,6 +6,13 @@ if test "$VERBOSE" = yes; then stty --version fi +tty -s || have_input_tty=no +if test "$have_input_tty" = no; then + echo "$0: This test must have a controlling input \`terminal'," 1>&2 + echo "so it may not be run via rsh" 1>&2 + exit 77 +fi + # The following list of reversible options was generated with # grep -w REV stty.c|sed -n '/^ {"/{s//REV_/;s/".*/=1/;p;}'|fmt REV_parenb=1 REV_parodd=1 REV_hupcl=1 REV_hup=1 REV_cstopb=1 REV_cread=1 diff --git a/tests/stty/row-col-1 b/tests/stty/row-col-1 index c4be661..f4a2374 100755 --- a/tests/stty/row-col-1 +++ b/tests/stty/row-col-1 @@ -6,6 +6,13 @@ if test "$VERBOSE" = yes; then stty --version fi +tty -s || have_input_tty=no +if test "$have_input_tty" = no; then + echo "$0: This test must have a controlling input \`terminal'," 1>&2 + echo "so it may not be run via rsh" 1>&2 + exit 77 +fi + # Versions of GNU stty from shellutils-1.9.2c and earlier failed # tests #2 and #4 when run on SunOS 4.1.3. -- 2.7.4