From 9728ed68f306d6acf9522d086c84d9224cdc2808 Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 27 Nov 2022 00:08:39 -0500 Subject: [PATCH] fixed printf sending errors to stdout --- tomcat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tomcat b/tomcat index 2f624d9..f59bac2 100755 --- a/tomcat +++ b/tomcat @@ -20,10 +20,10 @@ if test -n "$(printf "%s\n" "$argv1" | sed -n '/.*\..*/p')"; then # cut out everything before the first period for KEY KEY=$(printf "%s\n" "$argv1" | sed -n 's/^[^.]*\.//p') ! test -n "$KEY" &&\ - printf "%s: No key specified\n" "$argv0" &&\ + printf "%s: No key specified\n" "$argv0" 1>&2 &&\ exit 65 # sysexits(3) EX_DATAERR else - printf "%s: No key specified\n" "$argv0" + printf "%s: No key specified\n" "$argv0" 1>&2 exit 65 # sysexits(3) EX_DATAERR fi @@ -64,7 +64,7 @@ if test -n "$ARR"; then printf "%s\n" "$VAL" | sed 's/ /\n/g' | head -n "$ARR" |\ tail -n 1 elif ! test -n "$VAL"; then - printf "%s: %s: No such key or table\n" "$argv0" "$argv1" + printf "%s: %s: No such key or table\n" "$argv0" "$argv1" 1>&2 exit 65 # sysexits(3) EX_DATAERR else printf "%s\n" "$VAL"