[lug] Appending a file to files

Glenn Murray gmurray at Mines.EDU
Tue Jan 16 11:41:04 MST 2001


On Tue, 16 Jan 2001, Ken Weinert wrote:
> * Atkinson, Chip (CAtkinson at Circadence.com) [010116 17:20]:
> > Ok.  Try this:
> > 
> > for i in $(ls bar); do
> >   cat foo >> $i
> > done
> 
> Or, combine the two - it really depends on whether bar contains
> subdirectories, whether you want to recurse them, etc:
> 
> for file in $(find bar -type f); do
>   cat foo >> $file
> done

The first script above put the concatenated files into 
the home directory---not into bar/.  However, the
second script did the trick.

Thanks, Ken.

Glenn

P.S.  My apologies for all the double postings.  For
some reason posting from my Linux partition was
happening much more slowly than from my Windows
partition, even though I'm using pine in both
and going through the same campus server.






More information about the LUG mailing list