Commit | Line | Data |
---|---|---|
21c4e167 H |
1 | #!/bin/sh |
2 | ||
b16422a7 | 3 | while getopts ":a:b:c:d:f" OPT; do |
21c4e167 | 4 | echo "$OPT ==> $OPTARG"; |
b16422a7 TM |
5 | case $OPT in |
6 | a ) ahoj=$OPTARG;; | |
7 | ||
8 | '?') echo "Unknown option: -$OPTARG" >&2; exit 1;; | |
9 | ':') echo "Missing option argument for -$OPTARG" >&2; exit 2;; | |
10 | * ) echo "Unimplemented option: -$OPT" >&2; exit 3;; | |
11 | esac | |
21c4e167 H |
12 | done |
13 | ||
b16422a7 | 14 | echo |
21c4e167 | 15 | shift $(($OPTIND -1)); echo "Rest: $@"; |
b16422a7 TM |
16 | |
17 | : ${ahoj:=default} | |
18 | echo ahoj: $ahoj |