I’m trying to figure out a script file that takes in a file containing list of files (each line is a path to file i.e. path/to/file) and merge them into a file.
For example:
list.text
--
path/to/filename
filename
Then call the script like so
merge_script.sh list.txt final_file.txt
Any help is appreciated. I’m very handicapped with bash script and hope that some unix guru can help me come up with it quickly. Otherwise it will take me a couple hours to do it right (well, assuming that I ever get it right). I have been hunting for some examples and put them together. No luck so far.
Thanks,
Jack
xargswill send the file names fromlist.texttocat, in batches (so they won’t overflow the command line). Thencatwill print the contents of each file, with the output redirected tofinal_file.text.