[PLUG] To bash or not to bash?

Galen Seitz galens at seitzassoc.com
Sat Nov 7 18:49:57 UTC 2009


This may not be relevant for your situation, but just in case...

It's not unusual to pipe the output of find to the xargs command.  One 
thing to watch out for when doing this is filenames that contain 
spaces.  A pipe like this will have problems if any of the filenames 
contain spaces:
   find . -name '*.txt' | xargs grep foo

To deal with spaces in filenames, the command needs to be changed to this:
   find . -name '*.txt' -print0 | xargs -0 grep foo

-- 
Galen Seitz
galens at seitzassoc.com



More information about the PLUG mailing list