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
Post a Comment