more error messages
This commit is contained in:
parent
060fa4ceba
commit
1e6d0f2154
9
tomcat
9
tomcat
@ -19,9 +19,12 @@ 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" &&\
|
||||
exit 65 # sysexits(3) EX_DATAERR
|
||||
else
|
||||
# assume the argument is a table
|
||||
TABLE="$argv1"
|
||||
printf "%s: No key specified\n" "$argv0"
|
||||
exit 65 # sysexits(3) EX_DATAERR
|
||||
fi
|
||||
|
||||
# remove array index from KEY
|
||||
@ -61,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"
|
||||
exit 65 # sysexits(3) EX_DATAERR
|
||||
else
|
||||
printf "%s\n" "$VAL"
|
||||
|
Loading…
Reference in New Issue
Block a user