質問

I've got a list of filepaths, and would like to get the data from each of these files into a single communal file. The list of filepaths is in a file one-per-line, so I was hoping I could do something like:

cat listofpaths.txt >> combineddata.txt

Obviously that won't work since that's just going to get me the paths rather than the stuff within them - hmm...

I could do this using Python, but I'm assuming there a 1-liner to do it using a UNIX pipeline - anyone know what it'd be?

役に立ちましたか?

解決

A simple solution:

cat listofpaths.txt | xargs cat >> combineddata.txt
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top