This is the mail archive of the
mailing list for the Cygwin project.
Re: Question about ash and getopts
At 02:00 PM 12/29/2003, Peter Seebach you wrote:
>In message <DLEDLBGGCHGDFMMGKBHBAELBCDAA.firstname.lastname@example.org>, "Blair P. Houghto
>>So I take it this "idiom" is only supposed to work in newer cygwin versions?
>I dunno. It's a very, very, odd idiom, that leaves you stuck with a great
>deal of manual parsing anyway.
>>And I too am puzzled why someone would defeature a shell instead
>>of letting it work with either method. I don't see it as a
>>portability issue unless you think a significant number of users
>>will be porting their scripts from systems running cygwin to systems
>>running atavistic variants of UNIX.
>I did check; SunOS 4.1.3 had getopts too. So, basically, it's portable
>to everything except the 3b1 and 3b2, and possibly old versions of OSF/1.
>But, most importantly, it's in POSIX. I can see no reason for /bin/sh to not
>be at least reasonably close to a POSIX shell, when the code is already
>The "it saves space" argument is implausible, and frankly counterproductive;
>it should be obvious to the casual reader that calls to getopt are MUCH more
>expensive than a shell with getopts in it, as is the other option, running
>bash instead. A shell without getopts may be marginally smaller, such that
>scripts which don't use getopts are "faster"... But did anyone actually
>measure this making a difference, or is this just Little Tin God optimization
If you're curious, I suggest you run some timings on ash with and without
getopts enabled using a few configure scripts from some of Cygwin's
packages, large and small. It was the slowness of configure scripts
that prompted the streamlining of Cygwin's ash. If you can provide
data that suggests that there isn't a performance penalty for these
scripts with getopts on, then a patch to turn it back on may be considered.
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html