Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Dec 2006 17:11:27 -0800
From:      perryh@pluto.rain.com
To:        youshi10@u.washington.edu
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Search & Replace Issue
Message-ID:  <458f253f.lr+F6Ryq//l/Tjtv%perryh@pluto.rain.com>
In-Reply-To: <458EDE70.4050008@u.washington.edu>
References:  <BAY125-F30049BC3F42C8F2E17BA61CCC30@phx.gbl> <458EDE70.4050008@u.washington.edu>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> >> From this:
> > <li><a href="http://www.domain.com/tales/wouf.html
> > To this:
> > <li><a href="tales/wouf.html
> >
> > In other words, I just want the relative path and remove all
> > the extra: http://www.domain.htm/  portions of the lines.
...
> cat file.html | sed -e "s|http://www.domain.com||g" > file.tmp.html && 
> mv file.tmp.html file.html

I don't think the "cat" accomplishes anything in a case like this
(and BTW he also wanted to remove the / after com):

sed -e "s|http://www.domain.com/||g" < file.html > file.tmp.html ...

Additional logic (or use of -i) may be desirable to avoid loss of
file ownership and permission settings.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?458f253f.lr+F6Ryq//l/Tjtv%perryh>