[prev in list] [next in list] [prev in thread] [next in thread]
List: ast-users
Subject: [ast-users] A couple of things
From: zmsjeu47-kshtjdoyle () yahoo ! com (Terrence J ! Doyle)
Date: 2005-12-03 1:27:22
Message-ID: 43913927.5080100 () yahoo ! com
[Download RAW message or body]
David Korn wrote:
>>First:
>>
>>ksh88 -c 'getopts x opt +x; print "$opt"'
>>+x
>>ksh93 -c 'getopts x opt +x; print "$opt"'
>>?
>>
>>The man page still says that + can be used for option introduction.
>>
>>
>ksh93 requires that the option string start with a + (or :+) to
>allow options beginning with +. This is documented in the New KornShell
>Command and Programming Language book. I will fix the other documentation.
> ksh93 -c 'getopts +x opt +x; print "$opt"'
>will work.
>
>
When I type:
$ getopts --man
the following appears regarding including + and : in optstring:
If the leading character of optstring is +, then
arguments
beginning with + will also be considered options.
A leading : character or a : following a leading + in
optstring
affects the way errors are handled. ...
It's been my experience that :+ at the beginning of optstring produces
the desired results as you indicate above. However, getopts --man seems
to say, incorrectly, that +: is the sequence.
While I'm on the subject of getopts documentation, it looks like there's
another misprint in the statement:
If OPTARG is set to the value 1, a new set of arguments
can be
used.
Shouldn't that be OPTIND instead of OPTARG?
Both of these appear in ksh Version M 1993-12-28 q.
>>Both of these occur in "Version M 1993-12-28 o" under OpenServer and
>>"Version M 1993-12-28 r-" under OS X.
>>
>> John
>>--
>>John DuBois johnd@sco.com KC6QKZ/AE
>>I wish to God these calculations had been executed by steam. - Charles Babbage
>>_______________________________________________
>>ast-users mailing list
>>ast-users@research.att.com
>>https://mailman.research.att.com/mailman/listinfo/ast-users
>>
>>
>>
>
>David Korn
>dgk@research.att.com
>_______________________________________________
>ast-users mailing list
>ast-users@research.att.com
>https://mailman.research.att.com/mailman/listinfo/ast-users
>
>
Terrence J. Doyle
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic