From c6852b70b860baecf8efa526631f6ec42f0a693e Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 6 Apr 2018 07:56:31 +0200 Subject: [PATCH] gopher.sh: disabling the escape sequences with ENV --- gopher.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gopher.sh b/gopher.sh index 56fe265..0042756 100755 --- a/gopher.sh +++ b/gopher.sh @@ -1,5 +1,12 @@ #!/bin/sh +# ENV variables: +# LINK_COLOR: escape sequences colour (def: 2) +# - : means no escape sequence +# 1 : means colour 1 +# 2 : means colour 2 +# [...] + SERVER="$1" SELECTOR="$2" PORT="$3" @@ -18,12 +25,13 @@ if [ "$SERVER" = "" ]; then exit 2 fi -LINK_COLOR=2 # can be empty for no escape sequences +# can be "-" for no escape sequences +[ "$LINK_COLOR" = "" ] && LINK_COLOR=2 # Start and end link tags SL= EL= -if [ "$LINK_COLOR" != "" ]; then +if [ "$LINK_COLOR" != "-" ]; then SL="`tput setf $LINK_COLOR``tput setaf $LINK_COLOR`" EL="`tput init`"; fi -- 2.27.0