James Youngman wrote:
---The program run by xargs is invoked directly with execvp(), and so the arguments are not processed by the shell at all. This means that spaces and other special characters in the file names (if they are file names) are not treated specially at all. For this reason it shouldn't be neccessary to use quotes.
The only time things don't work out quite this way is when the program you are invoking is itself a shell script.
I think this has been the case a few times. As for worrying about quotes within my filenames, yes, it could be a concern, but quotes in file
names are less likely than spaces in my usage.
In this situation the
arguments will be correctly passed to the shell script but the script may not be processing such arguments directly. Within the script, spaces within the filenames are protected by correct quoting, for example "$@".
--- Would that put double quotes around the entire argument list rather than each item?
The xargs program also, by default, separates its arguments with spaces. When it is operating in this mode, it does interpret quotes as I think you are hoping. However, if you need to process arguments which contain spaces and newlines, it is best to use xargs' "-0" option, which corresponds to find's "-print0" action.
--- Should the -0 option ... yeah, I guess it should thinking about how they are passed....I'll give that a try to see if it clears up some of my space/quote clutter...
Cheers! Linda
_______________________________________________ Bug-findutils mailing list Bug-findutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-findutils