delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/12/29/14:17:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.0.1.1.0.20031229140746.02c43c40@127.0.0.1>
X-Sender:
Date: Mon, 29 Dec 2003 14:13:56 -0500
To: seebs AT plethora DOT net (Peter Seebach), cygwin AT cygwin DOT com
From: Larry Hall <cygwin-lh AT cygwin DOT com>
Subject: Re: Question about ash and getopts
In-Reply-To: <200312291900.hBTJ0Gqd014331@guild.plethora.net>
References: <Your message of "Mon, 29 Dec 2003 11:10:23 MST." <DLEDLBGGCHGDFMMGKBHBAELBCDAA DOT blair AT houghton DOT net> <200312291900 DOT hBTJ0Gqd014331 AT guild DOT plethora DOT net>
Mime-Version: 1.0

At 02:00 PM 12/29/2003, Peter Seebach you wrote:
>In message <DLEDLBGGCHGDFMMGKBHBAELBCDAA DOT blair AT houghton DOT net>, "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
>written.
>
>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?


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
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019