
On 2013-06-04 23:45, Craig Sanders wrote:
On Tue, Jun 04, 2013 at 10:45:38PM +1000, Matthew Cengia wrote:
Using tr to convert newlines to \0 for parsing with xargs -0 is no better than using xargs without -0. How does tr know whether a newline is part of the filename, or a delimiter between filenames? Only the program generating the file list could know that.
tr doesn't and can't.
it's still a LOT better (than xargs' default of white-space as a delimter) because even though \n is a valid character in a filename, [...]
My apologies, for some bizarre reason I assumed that xargs defaulted to newline-delimited rather than whitespace-delimited. In this case you're right; explicitly forcing newline delimiting using any method is less bad. -- Regards, Matthew Cengia