GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added phase comment to goertzel
[mirrors/Programs.git]
/
bash
/
getopts.sh
diff --git
a/bash/getopts.sh
b/bash/getopts.sh
index 270410ae89dac1d7f1c07c8c70d0c6e709572b60..f65d50ba73ec76dd298d1cafef8f84e31f364092 100755
(executable)
--- a/
bash/getopts.sh
+++ b/
bash/getopts.sh
@@
-1,7
+1,18
@@
#!/bin/sh
#!/bin/sh
-while getopts "
a:b:c:d:
" OPT; do
+while getopts "
:a:b:c:d:f
" OPT; do
echo "$OPT ==> $OPTARG";
echo "$OPT ==> $OPTARG";
+ case $OPT in
+ a ) ahoj=$OPTARG;;
+
+ '?') echo "Unknown option: -$OPTARG" >&2; exit 1;;
+ ':') echo "Missing option argument for -$OPTARG" >&2; exit 2;;
+ * ) echo "Unimplemented option: -$OPT" >&2; exit 3;;
+ esac
done
done
+echo
shift $(($OPTIND -1)); echo "Rest: $@";
shift $(($OPTIND -1)); echo "Rest: $@";
+
+: ${ahoj:=default}
+echo ahoj: $ahoj
This page took
0.105904 seconds
and
4
git commands to generate.