Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/bin/bash
  2. function main
  3. {
  4. echo here
  5. while getopts "Ah" cli_opt; do
  6. case ${cli_opt} in
  7. A)
  8. echo "op A"
  9. start_all
  10. return $?
  11. ;;
  12. *)
  13. echo invalid option
  14. showHep
  15. exit 1
  16. ;;
  17. h)
  18. showHelp
  19. exit 0
  20. ;;
  21. ?)
  22. invalid option
  23. showHelp
  24. exit 1
  25. ;;
  26. :)
  27. option -$OPTARG requires an argument
  28. showHelp
  29. exit 1
  30. ;;
  31. esac
  32. done
  33. }
  34.  
  35. main
  36. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement