I'm trying to concatenate files in subdirectories with the same folder name. Say concatenate all the files in the 'current' subdirectories in 'Literature' parent directory.
Literature/USA/current/
Literature/Europe/current/
Can anyone help with it? Thanks a lot!
thegeek
November 9, 2009, 11:34am
2
this works, but not to a great extent.
$ cat script.sh
for i in `find . -not -iname '.' -type d`
do
echo $i
cd $i
find . -maxdepth 1 -type f -exec cat {} >> ./$i.file \;
cd ..
done
you have this same question already here..
http://www.unix.com/unix-dummies-questions-answers/122954-recursively-concatenate-files-subdirectories-same-folder-name.html\#post302368457
try editing that script to your need, for clarifications come here again..
A oneline title with nothing in the msg body wont help...provide an example of what you mean by all this.