ttcn3-tcpdump*.sh: Fix output of special chars

Don't print '-e' option in non-bash shells.

Related: OS#5736
Change-Id: Idac0f902d2f5eb142a3f130409451c8f77b111f6
This commit is contained in:
arehbein 2022-11-13 18:48:58 +01:00
parent bc85a324be
commit bf45a5cff8
1 changed files with 10 additions and 3 deletions

View File

@ -24,10 +24,17 @@ kill_rm_pidfile() {
date date
if [ x"$VERDICT" = x"pass" ]; then # -e only works/is required only in Bash; in dash/POSIX shells it isn't required and will be part of the output
echo -e "\033[1;32m====== $TESTCASE $VERDICT ======\033[0m" if (lsof -p $$ | grep -q /usr/bin/bash); then
ESCAPE_OPT="-e"
else else
echo -e "\033[1;31m------ $TESTCASE $VERDICT ------\033[0m" ESCAPE_OPT=""
fi
if [ x"$VERDICT" = x"pass" ]; then
echo $ESCAPE_OPT "\033[1;32m====== $TESTCASE $VERDICT ======\033[0m"
else
echo $ESCAPE_OPT "\033[1;31m------ $TESTCASE $VERDICT ------\033[0m"
fi fi
echo echo