For the Mac and two of my boxes ksh -c 'print $((KSH_VERSION))' returns 0.
Those are all ksh93s+ with various dates, all still older then 2008-08-08. One
linux box returns back a nice date value (20090501). But that is the one box
I'm not supposed to be developing on. I wonder when Apple will get around to
updating ksh93 in OSX? No time soon, I'd guess. As for the linux boxes, it's
time to buy my SA a beer (or two).
Using your example below all of my versions (Version M 1993-12-28 s+ ..to..
JM 93t+ 2009-05-01 ) of ksh return
:10=now:11=-20:11=-21:12=1:13=1:14=1:
Yet, in my test script the 93t returns 'aaa' as the optarg instead of '−20'. I
must have something not exactly right in my USAGE. I'll keep working on it in
my spare moments.
Thanks for the insight, you've been a great help.
Eric
On 9 Feb 2010, at 15:03 , Glenn Fowler wrote:
>
> this command (source below)
> test-getopts --date=now --flag=aaa --flag=bbb --user --media --verbose
> prints
> :10=now:11=-20:11=-21:12=1:13=1:14=1:
> for ksh93 versions as old as 2001-05-04
> modulo suboption bugs for these releases:
> 2007-11-15 :10=now:11=aaa:11=bbb:12=:13=:14=:
> 2007-11-20 :10=now:11=aaa:11=bbb:12=:13=:14=:
> 2007-11-27 :10=now:11=aaa:11=bbb:12=:13=:14=:
>
> for releases since 2008-08-08 this
> ksh -c 'print $((KSH_VERSION))'
> will print the ksh release version as YYYYMMDD so it can be used in arithmetic
> and lexicographic comparisons
>
> cat > test-getopts <<'!'
> USAGE=$'
> [-]
> [10:date?Set the delivery date to \adate\a.]:[date]
> [11:flag?Set the foobar to \atype\a.]:[type]
> {
> [20:aaa?Desc of this type.]
> [21:bbb?And this does something else.]
> }
> [12:user?Retrieve user data.]
> [13:media?Retrieve media content.]
> [14:verbose?Verbosity is good sometimes.]
> '
>
> while getopts "${USAGE}" OPT
> do print -n -- ":$OPT=$OPTARG"
> done
> print ":"
> !
>
<snip>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users