fixed printf sending errors to stdout

This commit is contained in:
Emma Tebibyte 2022-11-27 00:08:39 -05:00
parent 60eba51303
commit 9728ed68f3
1 changed files with 3 additions and 3 deletions

6
tomcat
View File

@ -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"