I am writing a simple program to run through many files in different directories on my system. This mainly concerns their discovery and XML validation. One of the options for this program is a list of bad xml files.
This leads me to my question. What is the best result for formatting this for use with XARGS. I thought that each entry on a new line would be good enough, but it seems a bit confusing. because file names have spaces.
So my conclusion 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 continues to say "There is no such file or directory."
./myprogram.py --list BADXML | xargs -d '\n' cat
So, I either misunderstand how to use XARGS, or I need to slightly change the output format of my program. I'm not sure the easiest to use) route to take here. I would not want to always mess up the xarg options if I can avoid it.
source
share