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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -