Rejecting device names which are not a single word

This commit is contained in:
Thomas Schmitt 2019-12-03 22:07:34 +01:00
parent 7fa1f82ed9
commit f419f51f1e

View File

@ -211,10 +211,17 @@ arg_interpreter() {
print_usage print_usage
exit 0 exit 0
elif echo "$i" | grep -v '^-' >/dev/null elif echo "$i" | grep -v '^-' >/dev/null
then
num=$(echo "$i" | wc -w)
if test "$num" = 1
then then
devs_named=y devs_named=y
devs="$devs $i" devs="$devs $i"
show_reasons=y show_reasons=y
else
echo "$0 : Given device name is not a single word: '$i'" >&2
exit 12
fi
else else
echo "$0 : Unknown option: $i" >&2 echo "$0 : Unknown option: $i" >&2
echo >&2 echo >&2