title: Rebuild shell script to case
body: <p>I want to rebuild my script a little bit to make it more easier for other people. 
  I think it will be more easier with case and functions.</p>
  
  <pre><code>IP="192.168.123." #$1 is the last number for the ip-address
  
  regExp="^[0-9]+[-,0-9]*$"
  
  if [ "$#" -eq 0 ]; then    
  echo "No numbers given "
  exit 0                 
  fi
  
  if [ "$1" == "-h" ]; then
      echo "Give numbers to test"
      exit 0               
  fi
  </code></pre>
  
  <p>I want to make something like this:</p>
  
  <pre><code> if [ "$#" -eq 0 ]; then    
      echo "No numbers given "
      # exit 0    --&gt; do I have to write this?
  
  case
  -h ) echo "Give numbers to test";   
  
  esac      
  
      fi
  </code></pre>
  
  <p>Do I have to write that exit?
  Are there things to make it easier?</p>