Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • would this combine the files? Commented Aug 24, 2015 at 23:55
  • I want to combine the context of the file. e.g. file1.txt has line1 line2 file2.txt has line3 line4 I want to combine them into a new file that has line1 line2 line3 line4 Commented Aug 24, 2015 at 23:56
  • So pass the filenames to cat instead of print -l. Commented Aug 24, 2015 at 23:58
  • thats what I am currently doing. Is there a way to automate this. Please see the edit in the question, may be that would make it clear Commented Aug 25, 2015 at 0:00
  • This is not working for me. I have file names as variables in a list, the above code gives me error. I am accessing them as ${filenames[1,3]} but doing this only copies the content of 2nd file into the new file Commented Aug 25, 2015 at 0:14