delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/27/19:47:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
From: "Herb Martin" <HerbM AT learnquick DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Xargs positioning the arguments in a command -- is this a bug or a feature?
Date: Sat, 27 Aug 2005 18:47:11 -0500
MIME-Version: 1.0
Message-ID: <EILWNEN-000BVS-BV@mail2.learnquick.com>
X-Sign-LQC: HerbM AT learnquick DOT com/2005-08-27 18:47:13/<cygwin AT cygwin DOT com>=dielwiqf

CygWin 1.5.18

I was trying to create a date-time-sortable list of
files with an appended tag for each entry (ham or
spam flag if you care about the detail) and had some
difficulty with xargs:

dir -gGtcr --time-style=+%Y%m%d%X | cut -c 24- | xargs -i -n 2 echo {}
MORE_STUFF

...doesn't work -- i.e., "{}" appears in the output.

However, reversing the switches does work as expected:

dir -gGtcr --time-style=+%Y%m%d%X | cut -c 24- | xargs -n 2 -i echo {}
MORE_STUFF

I am curious if this is expected behavior as I didn't
see any warning in the xarg --help or man/info entries.

It is an unusual command that requires switches to 
appear in a specific order, especially when the 
switches are not directly dependent on each other.

--
Herb Martin


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

- Raw text -


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