Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'xargs is not safe' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
xargs is not safe
Authored by: fredcondo on Nov 26, '02 12:02:57PM

xargs will choke on any paths that contain spaces, a common occurrence on Macs. Probably the safest command on a Mac is this:

sudo find / -name .DS_Store -print -exec rm -f "{}" \;



[ Reply to This | # ]
xargs is not safe
Authored by: kent37 on Nov 26, '02 12:24:07PM

Don't the -print0 and -0 make xargs process spaces correctly?



[ Reply to This | # ]
xargs -0 is safe
Authored by: Bernd P. Ziller on Nov 26, '02 12:45:31PM

Using 'find -print0 | xargs -0' is safe.

The pathname will be printed followed by an ASCII NUL character, and xargs will use the ASCII NUL as argument separator.

Perfectly safe...



[ Reply to This | # ]