[lug] Appending a file to files

charles at lunarmedia.net charles at lunarmedia.net
Tue Jan 16 11:21:26 MST 2001


> >
> > find bar -exec cat foo >> {} \;
> >

you may want to try:

#!/bin/bash
#

# path to the file that contains the text you want to append
FOO="/path/to/filename"

# find files that you want to append to
find bar -exec > /tmp/files.tmp

# append the info you wanted
while read I; do
	cat $FOO >> $I
done < /tmp/files.tmp

# clean up your tmp file
rm /tmp/files.tmp

exit 0





More information about the LUG mailing list