Advertisement
sheffield

getopts1.sh

Mar 14th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.18 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while getopts ":a" opt; do
  4.   case $opt in
  5.     a)
  6.       echo "-a was triggered!" >&2
  7.       ;;
  8.     \?)
  9.       echo "Invalid option: -$OPTARG" >&2
  10.       ;;
  11.   esac
  12. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement