[BusyBox] Problems with xargs !!!
Steven Scholz
steven.scholz at imc-berlin.de
Mon Mar 31 09:53:03 UTC 2003
Ronny Arild schrieb:
> | -----Original Message-----
> | From: Steven Scholz [mailto:steven.scholz at imc-berlin.de]
>
> | But would it be hard to change busybox's xargs to behave
> | like xargs on other (let's say MY) machine!?
> |
> | So while parsing the command line just treat everything
> | after (and including) the first argument without a "-" as the [command
> | [initial-arguments]] as stated in xargs' man page.
> |
> | ~# find . -name rc.sh | xargs -t egrep -n "ipcal"
> | | | |
> | | | +- initial-arguments
> | | +------ command (no "-")
> | +---------- xargs argument
>
> You can solve this by adding the following code to xargs_main():
>
> int xargs_argc;
>
> for (xargs_argc = 1; xargs_argc < argc; xargs_argc++)
> if (*argv[xargs_argc] != '-')
> break;
>
> Then use xargs_argc as parameter to getopt() instead of argc, and
> also use xargs_argc instead of optind below.
Thanks!
You mean something like that? (see attached file).
BTW: I think option "-p" (Prompt the user about whether to run each command)
is not working!
Steven
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xargs.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20030331/bae19da5/attachment.diff
More information about the busybox
mailing list