Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: Chris Faylor <cgf@cygnus.com>
Date: Tue, 10 Oct 2000 16:29:48 -0400
To: cygwin@sources.redhat.com
Subject: Re: getopts missing with latest cygwin
Message-ID: <20001010162948.D5706@cygnus.com>
Reply-To: cygwin@sources.redhat.com
Mail-Followup-To: cygwin@sources.redhat.com
References: <1001010201259.AA89692.SM@nike.ins.cwru.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.6i
In-Reply-To: <1001010201259.AA89692.SM@nike.ins.cwru.edu>; from chet@nike.ins.cwru.edu on Tue, Oct 10, 2000 at 04:12:59PM -0400

On Tue, Oct 10, 2000 at 04:12:59PM -0400, Chet Ramey wrote:
>> >No, it can't.  A separate program cannot propagate the changes to
>> >$OPTIND and $OPTARG back to the parent shell.
>> 
>> Btw, I based my assertion that it can be used as a separate program on this:
>> 
>> % ls -l /usr/bin/getopts
>> -rwxr-xr-x   1 bin      bin         1518 Jul 25  1995 /usr/bin/getopts
>> 
>> I have no idea how it actually is used with sh on this system, though.
>
>It's not.  It simply exists to satisfy a POSIX.2 requirement.  It need
>not be (and is not) useful.

It's not completely useless, though.  It does seem to parse command line
arguments:

% /usr/bin/getopts "a:" foo -a   
/usr/bin/getopts[7]: getopts: a argument expected

It obviously can't place them in the current environment, though.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

