I'm writing a simple program to run through a bunch of files in various directories on my system. It basically involves opening them up and checking for valid XML. One of the options of this program is to list bad xml files.
This leads me to my question. What the best output to format this for use with XARGS. I thought putting each entry on a newline would be good enough, but it seems a bit confusing. because the filenames all have spaces.
So say my output is:
./dir name 1/file 1.xml
./dir name 2/file 2.xml
./dir name 3/file 3.xml
I tried the following command, but it keeps saying "No such file or directory".
./myprogram.py --list BADXML | xargs -d '\n' cat
So.. I am either misunderstanding how to use XARGS or I need to slightly change the format of the output of my program. I am not sure the best easiest to use) route to take here. i would hate to have to always type a mess of xarg options if I can avoid it.