#!/bin/bash
## how to use case in bash script.
## author: Xiaoxu Guan at LSU HPC.
## Jan 30, 2016


echo

# check $1 for year.
if [[ ( $1 -ne "2015" ) && ($1 -ne "2016")  ]] ; then
   echo "Year must be 2015 or 2016!"
   echo "Quit!"
   echo
   exit 1
fi

# select year.
case "$1" in
  2015) echo "	==== $1 Calender ==== "; cal $1 ;;
  2016) echo "	==== $1 Calender ====" ; cal $1 ;;
esac

echo "shell level in the script: " $SHLVL

exit 0
