Need Help in Case Output (BASH) -
i have simple case says like
case "$1" in -b*) myfunction exit 0;; -b*) echo "invalid!" >&2 exit 1;; esac
what want when user input argument using "b", stuff myfunction. else, if user input using "b", print error , exit program.
however, happens when user input "b", prints
invalid! exit 1
instead of
invalid!
also, gives exit value of "0" instead of "1". know part did wrong?
replace in script
echo "invalid!" >&2 exit 1
by
echo "invalid!" >&2; exit 1
Comments
Post a Comment