delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/19/12:00:27

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
Date: Mon, 19 May 2003 08:57:41 -0700
From: Dario Alcocer <alcocer AT helixdigital DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ash missing 'getopts' builtin
Message-ID: <20030519085741.C19452@ns.helixdigital.com>
References: <20030519081134 DOT B19452 AT ns DOT helixdigital DOT com> <20030519152016 DOT GA29656 AT cygbert DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5.1i
In-Reply-To: <20030519152016.GA29656@cygbert.vinschen.de>; from corinna-cygwin@cygwin.com on Mon, May 19, 2003 at 05:20:16PM +0200

On Mon, May 19, 2003 at 05:20:16PM +0200, Corinna Vinschen wrote:
> On Mon, May 19, 2003 at 08:11:34AM -0700, Dario Alcocer wrote:
> Thanks but that's not how ash is supposed to be used.  Ash as part of
> the Cygwin distro is "code-minimized" under the assumption that it's
> *only* used for shell scripts using most plain bourne syntax (autoconf
> is actually one example) and that it's good to have a shell which is
> running fast since it doesn't have to care for the user interface.

Yes, you're right, I agree with you, features that are only useful for
interactive use (fg, bg, jobs) should not be compiled into ash, since
ash is meant only for batch (not interactive) use. However, getopts
isn't really an interactive feature; besides, an extra 13K in code
shouldn't slow ash down at all (if you'd like, I can do some testing to
confirm this.)

In fact, I'd say that getopts is almost necessary for scripting,
because its inclusion allows scripts to be on an equal footing with
compiled programs, in that both can accept command line options. This
means I can write small programs as shell scripts instead of as a
compiled program; this is entirely consistent with traditional Unix
programming philosophy, which encourages the use of shell scripts for
small programs.

> So, ash is compiled under Cygwin with job control disabled, with a few
> options missing to the `read command' etc.  If you actually need all
> these stuff, please use bash, not ash.

Well, I personally only need getopts; most of the Bourne shell scripts I
write take options, and not having this built-in means I have to change
all of them to use #!/bin/bash instead.

It's not really a problem, though. I just think including getopts is
entirely consistent with ash as a programming tool, and should not be
omitted. I hope you can reconsider it's inclusion. I understand that
your opinion, and that of cgf, trumps any opinion I may have :-)

-- 
Dario Alcocer -- Sr. Software Developer, Helix Digital Inc.
alcocer AT helixdigital DOT com -- http://www.helixdigital.com

--
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