summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-11-06 13:57:30 +0100
committerPhil Sutter <phil@nwl.cc>2024-11-06 16:09:52 +0100
commit2393d33d4c44c25faf7784414abe546baccf71e4 (patch)
tree819b0b5d58e74e725e7f3d91ee21f6829312cf98
parentffcf95e18c48b6a86acffb1630d65b07293581b5 (diff)
tests: shell: Print escape sequences with terminals only
If stdout is not a terminal, don't print the '[EXECUTING]' status line which has to be cleared again. Signed-off-by: Phil Sutter <phil@nwl.cc>
-rwxr-xr-xiptables/tests/shell/run-tests.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables/tests/shell/run-tests.sh b/iptables/tests/shell/run-tests.sh
index 2ad259c2..565b654e 100755
--- a/iptables/tests/shell/run-tests.sh
+++ b/iptables/tests/shell/run-tests.sh
@@ -165,7 +165,7 @@ do_test() {
rc_spec=`echo $(basename ${testfile}) | cut -d _ -f2-`
- msg_info "[EXECUTING] $testfile"
+ [ -t 1 ] && msg_info "[EXECUTING] $testfile"
if [ "$VERBOSE" = "y" ]; then
XT_MULTI=$xtables_multi unshare -n ${testfile}
@@ -173,7 +173,7 @@ do_test() {
else
XT_MULTI=$xtables_multi unshare -n ${testfile} > /dev/null 2>&1
rc_got=$?
- echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
+ [ -t 1 ] && echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
fi
if [ "$rc_got" == "$rc_spec" ] ; then