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 <gentoo-dev+bounces-30277-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1JljMN-0000Kf-S0
	for garchives@archives.gentoo.org; Tue, 15 Apr 2008 11:30:00 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 38D38E061F;
	Tue, 15 Apr 2008 11:29:58 +0000 (UTC)
Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190])
	by pigeon.gentoo.org (Postfix) with ESMTP id EEA4EE061F
	for <gentoo-dev@lists.gentoo.org>; Tue, 15 Apr 2008 11:29:57 +0000 (UTC)
Received: by nf-out-0910.google.com with SMTP id f5so485027nfh.26
        for <gentoo-dev@lists.gentoo.org>; Tue, 15 Apr 2008 04:29:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        bh=ArH/z3gs5BON95DlXQh5F41JVBwxk6LAqZp7vDdpePQ=;
        b=OQsCSQD40+02DucAdTPh/G22x+kTgdqnyx8Vd0OkPhktFNpTiqwDqj82KdS1UXoPLctIMJ//2y7TijJl9A9ehnJMu9gnFgnFB2jGADWA22w+9xlufdENFgQbDPsn5pEqDlhrakhh7hpS8zP6P+5v+9OidSU5g8Ibdj1MQ4ndV4A=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=googlemail.com; s=gamma;
        h=from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id;
        b=aFBxW+2zzbD5e6IEzYwtK9J9WSndxleQ5CwaZUI4FD5qzawGx3OGlBMGV/EA0XYBnntilJaEaC3t4bGO+ebsa1BGWW9al2TrMS7ifvRzzrrEnDFE7y7+r93d3gE+s2Fv5UPw6n7vGR8DwZXQgXAsjy5/kMMTk2bn+cMSBPZ74dg=
Received: by 10.78.135.20 with SMTP id i20mr5592908hud.24.1208258996365;
        Tue, 15 Apr 2008 04:29:56 -0700 (PDT)
Received: from shiny-one.home ( [81.158.38.24])
        by mx.google.com with ESMTPS id 39sm4502230hug.2.2008.04.15.04.29.54
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Apr 2008 04:29:55 -0700 (PDT)
From: David Leverton <levertond@googlemail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] escaping variables in sed expressions
Date: Tue, 15 Apr 2008 12:29:46 +0100
User-Agent: KMail/1.9.7
References: <48048E31.6040209@gentoo.org>
In-Reply-To: <48048E31.6040209@gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200804151229.47173.levertond@googlemail.com>
X-Archives-Salt: 93532b96-a972-4251-975d-94a8a7cc566b
X-Archives-Hash: b4716a6d4c308981ddfae936dbcba3ee

On Tuesday 15 April 2008 12:14:57 Marijn Schouten (hkBst) wrote:
> There are several option to handle this. I could use a less common
> delimiter or I could escape it: ${D//_/\_} instead of ${D}. I could use a
> sed expression that doesn't suffer from this problem (thanks to dleverton):
>
> sed -ne '\_^prefix = /usr/local_!{p;d}' -e "iprefix = ${D}" -i Makefile

Just to clarify, I didn't think of escaping when I suggested this.  Escaping 
is probably cleaner, and certainly easier to understand.
-- 
gentoo-dev@lists.gentoo.org mailing list