URL: <http://savannah.gnu.org/bugs/?51220>
Summary: [wishlist] Using -I with -n Project: findutils Submitted by: adanisch Submitted on: Sun 11 Jun 2017 02:14:25 AM UTC Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Originator Name: Originator Email: Open/Closed: Open Discussion Lock: Any Release: None Fixed Release: None _______________________________________________________ Details: It would be nice if you could use -I substitution option with -n count option together in the same command. E.g. $> var=/tmp && echo "one two three four" | xargs -n1 touch "${var}/{}" $> var=/tmp/test && mkdir -p "${var}" && echo "one two three four" | xargs -n1 | xargs -I{} cp -v "/tmp/{}" "${var}" ‘/tmp/one’ -> ‘/tmp/test/one’ ‘/tmp/two’ -> ‘/tmp/test/two’ ‘/tmp/three’ -> ‘/tmp/test/three’ ‘/tmp/four’ -> ‘/tmp/test/four’ Yet it would be nice if instead, we could: $> var=/tmp/test && mkdir -p "${var}" && echo "one two three four" |xargs -n1 -I{} cp -v "/tmp/{}" "${var}" cp: cannot stat ‘/tmp/one two three four’: No such file or directory Unfortunately we can't combine -n and -I substitution at the moment and I'm not sure why not. It could be useful. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51220> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/