3 ms·
It's too bad (for bash users) that bash never bothered to embrace ksh getopts. The equivalent of the article's two pages is roughly, usage=$' [-1][+N
by kps 6y ago
It's too bad (for bash users) that bash never bothered to embrace ksh getopts. The equivalent of the article's two pages is roughly,
usage=$'
[-1][+NAME?script - Script synopsis here]
[f:flag?Some flag description]
[p:param?Some param description]:[string?description]
'
while getopts "$usage" opt
do
typeset opt_${opt}=${OPTARG:-1}
done