>Joerg Schilling schrieb:
>> Thomas Maier-Komor wrote:
>>> I've just stumbled across that ksh93 doesn't accept getopts strings for
>>> long options that are accepted in the old ksh (e.g. 'h(help)').
>> ksh93 is completely based on AT&T code and uses it's own getopt that is
>> different from the one in libc.
> Jörg, thank you very much for the insight. How would one write a script
> that works both with Solaris 10's ksh and OpenSolaris' ksh93 that
> accepts long options?
the ksh getopts(1) uses the ast optget(3), which at one point added solaris
'h(help)' compatibility
verify that you are in a recent ksh93
this command line
getopts -a mycommand 'h(help)' OPT --man
should produce
---
SYNOPSIS
mycommand [ options ]
OPTIONS
-h, --help
---
for compatibility you will probably have to drop the '-a mycommand'
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]