"Pass one argument which is a string containing
all switches that take an argument."
So you can give 'ha' to getopts() and it will understand that these options don't take arguments. To do the same for getopt() you don't mention those options...? As it was, your mentioning 'h' to getopt() meant that getopt() ate up the next 'value' ('-a') for the option.
If I read it right then getopts('oif:') is matched by using getopt('f').
In reply to Re: Getopt: vs. Getopts confusion
by shenme
in thread Getopt: vs. Getopts confusion
by knexus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |