Advertisement
cd62131

Shell Script using case

Nov 12th, 2013
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | None | 0 0
  1. #!/bin/sh -e
  2. usage() {
  3.   cat <<_EOS_
  4. Usage: prog arg [0-5]
  5. _EOS_
  6.   exit 1
  7. }
  8. main() {
  9.   case $2 in
  10.   [0-5]) echo $1 $2;;
  11.   *) usage;;
  12.   esac
  13. }
  14. main $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement