Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Dec 2008 21:16:23 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        Gary Kline <kline@thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: well, blew it... sed or perl q again.
Message-ID:  <20081230201623.GB65659@slackbox.xs4all.nl>
In-Reply-To: <20081230193111.GA32641@thought.org>
References:  <20081230193111.GA32641@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Yylu36WmvOXNoKYn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Dec 30, 2008 at 11:31:14AM -0800, Gary Kline wrote:
> 	The problem is that there are many, _many_ embedded=20
> 	"<A HREF=3D"http://whatever>; Site</A> in my hundreds, or
> 	thousands, or files.  I only want to delete the
> 	"http://<junkfoo.com>" lines, _not_ the other Href links.
>=20
> 	Which would be best to use, given that a backup is critical?
> 	sed or perl?

IMHO, perl with the -i option to do in-place editing with backups. You
could also use the -p option to loop over files. See perlrun(1).

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--Yylu36WmvOXNoKYn
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAklagZcACgkQEnfvsMMhpyU+/ACffgWA7koUEwQ1+25aKrhUEw++
qrMAniS5zi3QQEfzu/neloXmVp6WZXuq
=TDud
-----END PGP SIGNATURE-----

--Yylu36WmvOXNoKYn--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081230201623.GB65659>