Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. : ${1:?first argument is required}
  4. : ${2:?second argument is required}
  5.  
  6. #!/bin/sh
  7. die() { echo "$@" >&2; exit 1; }
  8. case ${1?} in
  9. foo) test $# = 4 || die When first argument is foo, you must give 4 args;;
  10. bar) test $# = 2 || die When first argument is bar, only give 2 args;;
  11. *) ;;
  12. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement