linux - Rebuild shell script to case -


i want rebuild script little bit make more easier other people. think more easier case , functions.

ip="192.168.123." #$1 last number ip-address  regexp="^[0-9]+[-,0-9]*$"  if [ "$#" -eq 0 ];     echo "no numbers given " exit 0                  fi  if [ "$1" == "-h" ];     echo "give numbers test"     exit 0                fi 

i want make this:

 if [ "$#" -eq 0 ];         echo "no numbers given "     # exit 0    --> have write this?  case -h ) echo "give numbers test";     esac            fi 

do have write exit? there things make easier?

if statements inside case don't need exit

case "$1" in   '') echo no numbers given;;   -h) echo give numbers test;;   *) ... esac 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -