xargs (or find -exec) does not support the {} or the -I option. It is therefore not possible to use it when the command you need to execute takes options that come behind the arguments. The find command becomes much less powerfull for this reason.
Each bug report should be about one bug, not three. You report that: 1. find does not support {} 2. xargs does not support {} 3. xargs does not support -I #1 is not true: # ./busybox find README -exec echo ">{}<" ";" >README< #2 is not true per se - xargs should not handle {} specially, I think. #3 is true also for GNU xargs 4.1.20. Hmm. GNU xargs 4.4.0 has it working: # /usr/bin/xargs --version xargs (GNU findutils) 4.4.0 # echo qwe | /usr/bin/xargs -I _ echo mv 1/_ 2/_ mv 1/qwe 2/qwe
changed summary to read "xargs does not support -I"
I filed this bug a long time ago, but never saw anything happen with it. It's not that I'm impatient, but maybe I'm not being clear enough. You gave an example which I had to change a bit because I don't have that file README and it should really have '-name' as well This is what I get: # /bin/busybox find /bin -name busybox /bin/busybox # /bin/busybox find /bin -name busybox -exec echo ">{}<" ";" # No output there.... It does work on my Ubuntu: root@ubuntuLTS:/opt/ASSP/logs# find /usr/bin -name find /usr/bin/find root@ubuntuLTS:/opt/ASSP/logs# find /usr/bin -name find -exec echo ">{}<" ";" >/usr/bin/find<
(In reply to comment #3) > # /bin/busybox find /bin -name busybox > /bin/busybox > # /bin/busybox find /bin -name busybox -exec echo ">{}<" ";" > # > > No output there.... This definitely works for me (and for a lot of other people). Please specify exact busybox version and attach your .config - I will try to reproduce.
Still true for 1.19.
Per descriptiong of the problem... This is what I am receiving. /usr/bin/xargs: invalid option -- I BusyBox v1.19.0 (2012-02-29 14:20:08 PST) multi-call binary. Usage: xargs [OPTIONS] [PROG ARGS] Run PROG on every item given by stdin -p Ask user whether to run each command -r Don't run command if input is empty -0 Input is separated by NUL characters -t Print the command on stderr before execution -e[STR] STR stops input processing -n N Pass no more than N args to PROG -s N Pass command line of no more than N bytes -x Exit if size is exceeded
Fixed in git: commit 6f068904dc142657bb596f91196f9113f1838cbe Author: Denys Vlasenko <vda.linux@googlemail.com> Date: Thu Feb 27 11:17:06 2014 +0100 xargs: add support for -I and -i