delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/25/09:40:33

X-Recipient: archive-cygwin AT delorie DOT 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 AT niaid DOT nih DOT gov>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
CC: "moss AT cs DOT umass DOT edu" <moss AT cs DOT umass DOT 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 DOT 2627 DOT 140661067092681 DOT 0CBF054A AT webmail DOT messagingengine DOT com> <4F97DA45 DOT 9050100 AT cs DOT umass DOT edu>
In-Reply-To: <4F97DA45.9050100@cs.umass.edu>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019