Re: newbie sed question
From: jerrygarciuh (designs_at_no.spam.nolaflash.com)
Date: 05/30/04
- Previous message: Russell Shaw: "Re: gtk question: GtkComboBox"
- In reply to: Måns Rullgård: "Re: newbie sed question"
- Next in thread: jerrygarciuh: "Re: newbie sed question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 10:09:46 -0500
Thanks very much! I have a lot to learn about command line scripting!
jg
"Måns Rullgård" <mru@kth.se> wrote in message
news:yw1xd64mcnj6.fsf@kth.se...
> Lew Pitcher <lpitcher@sympatico.ca> writes:
>
> > To do what you should be doing
> >
> > ~ for file in `ls -R | grep 'index.php'` ;
> > ~ do
> > ~ sed 's/foo/bar/g' $file >$file.xxx
> > ~ rm $file
> > ~ mv $file.xxx $file
> > ~ done
>
> Or
>
> find . -name index.php | while read file; do
> sed 's/foo/bar/g' "$file" > "$file.xxx"
> mv "$file.xxx" "$file"
> done
>
> The quotes are necessary if the name of some directory contains
> whitespace.
>
> --
> Måns Rullgård
> mru@kth.se
- Previous message: Russell Shaw: "Re: gtk question: GtkComboBox"
- In reply to: Måns Rullgård: "Re: newbie sed question"
- Next in thread: jerrygarciuh: "Re: newbie sed question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|