Re: substitute strings in text files (links in html files)
On Fri, 15 Jan 1999, Oliver Thuns wrote:
> Hello!
>
> How could I substitute a string (links) in html files with standard
> Linux (debian) tools?
>
> i.e. I want to change every http://one.domain.com in
> http://two.domain.com in some files and files in subdirs.
>
sed -e "s/two/one/g" f1.html >f2.html
Don't redirect to your input file! You will lose it. If you need it to be
the same name, just rename afterwards. The "s/two/one/g" substitutes two
for one globally. Read sed's man page for more info.
> Oliver
>
>
> --
> Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
>
/----------------------------------------------------------\
| pretzelgod | pretzelgod@pretzelnet.com |
| (Eric Gillespie, Jr.) | epgilles@olemiss.edu |
|---------------------------<*>----------------------------|
| "That's the problem with going from a soldier to a |
| politician: you actually have to sit down and listen to |
| people who six months ago you would've just shot." |
| --President John Sheridan, Babylon 5 |
\----------------------------------------------------------/
Reply to: