From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JlnCN-0004ys-Gr for garchives@archives.gentoo.org; Tue, 15 Apr 2008 15:35:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B899E0722; Tue, 15 Apr 2008 15:35:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 16865E0722 for ; Tue, 15 Apr 2008 15:35:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5120F6675B; Tue, 15 Apr 2008 15:35:52 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] escaping variables in sed expressions Date: Tue, 15 Apr 2008 11:35:51 -0400 User-Agent: KMail/1.9.7 Cc: "Marijn Schouten (hkBst)" References: <48048E31.6040209@gentoo.org> In-Reply-To: <48048E31.6040209@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10704101.TT5nxKdxMD"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200804151135.51735.vapier@gentoo.org> X-Archives-Salt: efd376c8-4aa2-4b5f-b121-1f7e774e5005 X-Archives-Hash: 097122f80c4153ec3177d38b8a650353 --nextPart10704101.TT5nxKdxMD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 15 April 2008, Marijn Schouten (hkBst) wrote: > Hi list, > > it seems I have been using some fragile sed expression and I'd like to tap > the collective wisdom for avoiding doing that in the future. > > dev-scheme/slib-3.1.5-r1 currently does > > sed "s_prefix =3D /usr/local/_prefix =3D ${D}/usr/_" -i Makefile ignoring the escape character (which is currently standardized in the tree = as=20 a colon), expressions like this are inherently fragile due to makefile=20 changes. i tend to do: sed -i '/^prefix[[:space:]]*=3D/s:=3D.*:=3D/usr' Makefile =2Dmike --nextPart10704101.TT5nxKdxMD Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iQIVAwUASATLV0FjO5/oN/WBAQL+vhAAtU30XuwN6jXxbwBG9q/wFEgG0ezkJn+f 8YO5dRmwm7rURYRCoi1txbcdI7yMmrur/znyURFNXb4MOE/kTEvWvvbLKaQoCt/m kHyT+H0t2Uy8V38stCTX6kDRAWKLZ4SfY6dEvSMIVqtm7HlmKqDUJUkkv9KKg1Mq 1kWmq4MBjkmVvyIBC+FQ6H+oV+/xQp5ezPCw1Zv0p6YU4NKQkTvn1qQp/nu0QvFD zb6z/xzOnKmHfIw9+zWwfbpXWEZvdmceoYYQp5tB/D4WlA3lnBDGL7nUIGiCR+pX Fz2V2ipS1BmUC7gG9LLH4y+zOneykKMtw+xyXhs2Z4FNm/hmLTHzG9UDRcQZufA4 LA1DBJxDoBtq3ylMCo/R83+KFpLgVc2ewtPfj+Y/xgaT9wtS6JrVc1ZLBWnDKBaY 13yee/NFPBYNHeTvFAvNs5AxEDFct8wq0dIvi5S1tMl/gLTyiWHxR313LpejfdK0 8VAZ8GLfgwT03LIkXN1cMVz+gpal8ST0hWenbnDOsfjbR26/DRBLJnnid49GGIzv Y2JJJruSiN7z4HxInsoXw6SDRAJtvSjSDa6p9ggkWVlgetSx6utezLKHi01nYRsN gTOWEFvnotNpdaf/XnmxAufD6dwooQ6LFi+yq8BdC2wOL+jVnChDiiSq7Z97CwHL LwMTOznH+Vo= =MuHl -----END PGP SIGNATURE----- --nextPart10704101.TT5nxKdxMD-- -- gentoo-dev@lists.gentoo.org mailing list