Given the following shell script code snippet that accepts thename of a month and returns which month it is, change it so that itdoes this with a smaller code size.
read monthname
case $monthname in
## convert $monthname to number
[Jj][Aa][Nn]*) month=1 ;;
[Ff][Ee][Bb]*) month=2 ;; ## …put the rest of the yearhere
[Dd][Ee][Cc]*) month=12 ;; [1-9]|1[0-2]) month=$monthname ;;
## accept number if entered *) echo “Invalid month: $monthname”>&2 ;;
Expert Answer
An answer will be send to you shortly. . . . .