This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Xargs positioning the arguments in a command -- is this a bug or a feature?
- From: "Herb Martin" <HerbM at learnquick dot com>
- To: <cygwin at cygwin dot com>
- Date: Sat, 27 Aug 2005 18:47:11 -0500
- Subject: Xargs positioning the arguments in a command -- is this a bug or a feature?
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/