delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/04/25/06:30:15

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL
X-Spam-Check-By: sourceware.org
Message-Id: <1335349788.2627.140661067092681.0CBF054A@webmail.messagingengine.com>
From: Ronald Fischer <ynnor AT mm DOT st>
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
Subject: xargs: Why does order of command line switches matter?
Date: Wed, 25 Apr 2012 12:29:48 +0200
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

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


xargs (GNU findutils) 4.5.9
Packaged by Cygwin (4.5.9-2)

Ronald
-- 
Ronald Fischer <ronaldf AT eml DOT cc>
+  If a packet hits a pocket on a socket on a port, 
+  and the bus is interrupted and the interrupt's not caught,
+  then the socket packet pocket has an error to report.
+		(cited after Peter van der Linden)


--
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