[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash script question



On 05 May 2003 17:19:04 +0100
Oliver Elphick <olly@lfix.co.uk> wrote:

> On Mon, 2003-05-05 at 16:29, Rudy Gevaert wrote:
> > Hallo,
> > 
> > I have a directory with files, and in every file I want to replace:
> > templates/images
> > with
> > http://users.pandora.be/webworm/images
> > 
> > How can I do this in an easy way?
> 
> cd directory
> for f in `find . -type f`
> do
>    sed -e 's|templates/images|http://users.pandora.be/webworm/images|g' $f
>    >$$
>    cat $$ >$f    # do it this way to preserve existing ownership and perms
> done
> rm $$

Can the "for" line be replaced with

for f in *

What would be the difference, except being simpler and not using find? :)

Kevin



Reply to: