The options are following the filename rather than hh.sh. And the following code does not work.
while getopts ":ec" opt; do
case $opt in
e)
eflag=1
;;
c)
cflag=1
;;
esac
done
shift $(($OPTIND - 1))
what about something like this.
filename=$1
shift
while getopts ":ec" opt; do
case $opt in
e)
eflag=1
;;
c)
cflag=1
;;
esac
done
shift $(($OPTIND - 1))
echo $filename
echo $eflag
echo $cflag
grab the filename, then shift and run getopts?