This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about ash and getopts

In message <>, "Blair P. Houghto
n" writes:
>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
at work?


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]