Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Sent: 29 Dec 2003 18:10:23 GMT From: "Blair P. Houghton" To: Subject: RE: Question about ash and getopts Date: Mon, 29 Dec 2003 11:10:23 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In-Reply-To: <200312290807.hBT87Nqd019923@guild.plethora.net> X-IsSubscribed: yes Peter Seebach wrote: >In message <3FEFDE5B DOT 3000801 AT helixdigital DOT com>, Dario Alcocer writes: >>Use the "set -- `getopt`" idiom instead: >Yes, but *why*? ============== % cygcheck --version cygcheck version 1.30 System Checker for Cygwin Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Compiled on Feb 8 2003 % cat > bt.sh #!/bin/sh set -- `getopt` echo $0 $2 $4 echo $1 $3 $5 ^D % bt.sh 1 2 3 4 5 6 getopt: missing optstring argument Try `getopt --help' for more information. ./bt.sh =============== Hey. It got $0 right. So I take it this "idiom" is only supposed to work in newer cygwin versions? 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. --Blair -- 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/