I am looking for a command line that can do some operations on two files that have the same names but in different folders.
for example if
- folder
Acontains files1.txt,2.txt,3.txt, … - folder
Bcontains files1.txt,2.txt,3.txt, …
I would like to concatenate the two files A/1.txt and B/1.txt, and A/2.txt and B/2.txt, …
I'm looking for a shell command to do that:
if file name in A is equal the file name in B then:
cat A/1.txt B/1.txt
end if
for all files in folders A and B, if only names are matched.
catto go? Your example goes tostdoutbut I wasn't sure if that's your intention. Or do you have a 3rd file for each pair?