OILS
/
spec
/
testdata
/ getopts-1523.sh
View on Github
|
oilshell.org
9 lines, 9 significant
1
while getopts abc: opt; do
2
case
"
$opt
"
in
3
[ab]) printf
'
opt:%s\n
'
"
$opt
"
;;
4
c) printf
'
opt:%s arg:%s\n
'
"
$opt
"
"
$OPTARG
"
;;
5
*) printf
'
err:%s\n
'
"
$opt
"
;;
6
esac
7
done
8
shift $((OPTIND - 1))
9
[ $# -gt 0 ] && printf 'arg:%s\n' "$@"