The question is maybe trivial but I can’t get it to work. I just want to merge 2 particular files present in multiple specific folders into a new single file again in each specific folder.
cat */folder_*/*/file.a */folder_*/*/file.b > */folder_*/*/file.c
but it does not work ’cause
-bash: */folder_*/*/file.c: No such file or directory
So I thought maybe for some reason cat can’t create files (though it does), so I tried
touch */folder_*/*/file.c; cat */folder_*/*/file.a */folder_*/*/file.b > */folder_*/*/file.c
but again it does not work with cat or even touch.
I run the
cd && catin a subshell so you don’t have to cd back to where you started.