X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-5.2 required=5.0	tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
X-IronPortListener: Outbound_SMTP
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av4EAHH9l0+cKEdK/2dsb2JhbABFsUuBB4IJAQEBBBIoPxACAQgNCxwCEB8TJQEBBA4NGodtni+dE5AUYwSNNo5biiiDBQ
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
CC: "moss@cs.umass.edu" <moss@cs.umass.edu>
Date: Wed, 25 Apr 2012 09:39:05 -0400
Subject: RE: xargs: Why does order of command line switches matter?
Message-ID: <0105D5C1E0353146B1B222348B0411A20A6E562BB0@NIHMLBX02.nih.gov>
References: <1335349788.2627.140661067092681.0CBF054A@webmail.messagingengine.com> <4F97DA45.9050100@cs.umass.edu>
In-Reply-To: <4F97DA45.9050100@cs.umass.edu>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q3PDeT2W006099

On 4/25/2012 6:29 AM, Ronald Fischer wrote:
>Eliot Moss sent the following at Wednesday, April 25, 2012 7:05 AM
>
>> Why do I get a different output in the following two invocations of
>> xargs? I had expected that the relative order of the command line
>> switches (-I, -L) would not matter:
>>
>> $ ls | xargs -I DIR -L 1 echo DIR
>> DIR wontprint.txt
>> DIR x.cmd
>> DIR x.pl
>> DIR x.sh
>> $ ls | xargs -L 1 -I DIR echo DIR
>> wontprint.txt
>> x.cmd
>> x.pl
>> x.sh
>
>I agree that that is what happens, and that it does seem strange
>and buggy. I note, though, that -I *implies* -L 1, so the -L 1 is
>unnecessary. Perhaps the explicit mention of -L 1 "kills" the -I flag in
>xarg's command line processing. My guess is that this behavior is passed
>on from the upstream implementation and is not specific to cygwin, which
>means that the appeal for a change would probably need to be lodged
>elsewhere ...

From man xargs:

BUGS
       The  -L option is incompatible with the -I option, but perhaps should
       not be.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


