1 2 3 4 5 6 7 8 9 10 11 12 13
f() { typeset OPTIND=1 typeset opt while getopts ":abcxyz" opt do echo opt: "$opt" if [[ $opt = y ]]; then f -abc ; fi done } f -xyz