|
From: | Chet Ramey |
Subject: | Re: getopts: OPTARG should be unset after last option |
Date: | Wed, 23 Jun 2004 15:37:58 -0400 |
User-agent: | Mozilla Thunderbird 0.7 (Macintosh/20040616) |
Len Lattanzi wrote:
On Jun 23, 2004, at 11:10 AM, Chet Ramey wrote:As POSIX specifies. Why do you think it should not be? ChetFrom http://www.opengroup.org/onlinepubs/009695399/utilities/getopts.htmlWhen the option requires an option-argument, the getopts utility shall place it in the shell variable OPTARG . If *no option was found*, or if the option that was found does not have an option-argument, OPTARG shall be *unset*.
I believe that the operative paragraph is the one that begins "When the end of options is encountered". It does not specify that OPTARG be unset. I will take a look, though. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet ) Live...Laugh...LoveChet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/
[Prev in Thread] | Current Thread | [Next in Thread] |