Hi gurus, I have the following part of code which I am using for treating input
#!/bin/bash
while [[ $1 = -* ]]; do
arg=$1; shift
case $arg in
-u)
users="$1"
shift
;;
-g)
groups="$1"
shift
;;
-m)
mlength="$1"
shift
;;
-t)
dfileg="$1"
shift
;;
--help)
echo "-m maximum count of characters per line in group file"
echo "for errors see file called: errorlog"
break
;;
*)
break
;;
when I issue
./script -u john -g daemon -m 100 -t group
everything works fine
but when I issue
./script --help
the script echos text but did not exit. (I have to interrupt it by ctrl+c) how can I close script after issuing --help ? Thanks a lot
BTW is there any more elegant way of treating input ?