http://ss64.com/bash/case.html SHOWS
case word in [ [(] pattern [| pattern]...) command-list ;;]... esac
What are square brackets indicating? Other websites omit them (i.e. no [[(]
etc.)
http://www.thegeekstuff.com/2010/07/bash-case-statement/ shows this:
no use of [[(]
etc.
case expression in
pattern1 )
statements ;;
pattern2 )
statements ;;
...
esac
Thanks for the detailed responses below. I am extremely appreciative of the clarification.
Best Answer
Read the authoritative source: the GNU bash manual
https://www.gnu.org/software/bash/manual/bashref.html#Conditional-Constructs
The square brackets indicate optional stuff.
The only mandatory parts are:
case word in esac
-- this is valid bash that happens to do nothing.