Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Wed, 10 Nov 1999 16:05:40 -0500 To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: getopts problem Message-ID: <19991110160540.A15242@cygnus.com> Reply-To: cygwin AT sourceware DOT cygnus DOT com Mail-Followup-To: cygwin AT sourceware DOT cygnus DOT com References: <199911091350 DOT NAA00636 AT uksn71> <19991109090415 DOT A3345 AT cygnus DOT com> <19991110023536 DOT A27087 AT ba DOT best DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <19991110023536.A27087@ba.best.com>; from Glenn Spell on Wed, Nov 10, 1999 at 02:35:36AM -0500 On Wed, Nov 10, 1999 at 02:35:36AM -0500, Glenn Spell wrote: >On 9 Nov 1999 around 9:04AM (-0500) Christopher Faylor wrote: > >> On Tue, Nov 09, 1999 at 01:44:00PM +0000, Clive Bostock wrote: >> >> >However I now find that unless the 1st line of the shell script >> >has the #!path_to_bash/bash included, bash errors with "getopts >> >not found". >> >> /bin/sh != /bin/bash >> >> That's why. > >Well, more precisely, the /bin/sh he's using does not contain a >builtin getopts function like bash does. > >One solution is to change your SHELL environment variable. > >Another solution is: > > Of course most UNIX implementations of /bin/sh do not have a builtin 'getopts' implementation. I'd like to request that you add some way of identifying your version of ash so that it will be obvious what somebody's using. Otherwise I foresee confusion on the cygwin mailing list. >Frankly, I believe /bin/sh should be the "system" shell for Cygwin, >just as it is for FreeBSD and NetBSD. In fact, I only joined the >developers list when Chris posted "Just say no to ash"... I intended >to start hollering and screaming... but before I got my information >together, he changed his mind. Actually, I posted it as a question and asked for feedback, as I usually do with these things. I don't recall you providing any feedback but I could be mistaken. >When it comes to an open source posix compatible Bourne type shell, ash >is as good as it gets. (Anyone ever try running a miminally configed >bash in posix mode calling it as "sh". No thank you, at least... not >on Cygwin.) Except that I don't believe that ash actually *is* Posix compatible and it's not really that robust. It is riddled with small buffers which are easy to overrun, causing random errors. I spent a lot of time on the Cygwin CD poring over a version of ash, paring it down to the functionality of something like the shell found on Digital UNIX or HPUX. I also increased the size of every buffer I found dramatically. This is just a band-aid but the /bin/sh on the CD should be better than B20.1, FWIW. It's also a lot smaller. However, what this means is that there is, for instance, no 'alias', no keystroke editing, no built-in getopts, etc. >I made this last August from the ash source in NetBSD current. I >have never gotten around to going back and adding the stuff that >Chris got from the FreeBSD port... brace expansion and some signal >handling stuff if I recall correctly. Hopefully I didn't release an ash with brace expansion or improved signal handling. If they were in the sources, I ifdef'ed them. >Somewhere I have a comparison of my ash with the one that Chris >ported from FreeBSD and posted about in the developers list. > >Chris, is the /bin/sh on the CD the same as the one you had up in >your ftp area? (Sorry, I haven't purchased the CD yet.) Not exactly. No. cgf -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com