From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C49EE198005 for ; Sun, 3 Mar 2013 17:03:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 478C1E0912; Sun, 3 Mar 2013 17:03:35 +0000 (UTC) Received: from vms173001pub.verizon.net (vms173001pub.verizon.net [206.46.173.1]) by pigeon.gentoo.org (Postfix) with ESMTP id DB667E0912 for ; Sun, 3 Mar 2013 17:03:34 +0000 (UTC) Received: from odin.tremily.us ([unknown] [72.68.84.219]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MJ300LODGPIO960@vms173001.mailsrvcs.net> for gentoo-catalyst@lists.gentoo.org; Sun, 03 Mar 2013 11:03:21 -0600 (CST) Received: by odin.tremily.us (Postfix, from userid 1000) id 469548EBB86; Sun, 03 Mar 2013 11:53:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1362329604; bh=pntlzArhynML5cAv8TLrrHpDUMOuOpWDGtk/o2uksZY=; h=From:To:Cc:Subject:Date; b=PdwmTgmQiuzSBsP8xWJA5SBAZw05QDE9IpZqzKeE+PKolPrLtx+ksMKyMcsZRvCXI gDgu+uou4NGt5GI3sUmPIqFs17CcdwXlqgNmZEfauD8Cm7Y8rSYP1GHPMSZWHFh1yY WKfrr+clpB3qKf1d8S3wPy836EPyALbiQvxE/+dE= From: "W. Trevor King" To: Catalyst Cc: "W. Trevor King" Subject: [gentoo-catalyst] [PATCH] livecdfs-update.sh: Escape ampersands in STARTX sed expression Date: Sun, 03 Mar 2013 11:53:18 -0500 Message-id: <48b5405f720c6aa9e9472be0fc3a66e7ef336d3e.1362329514.git.wking@tremily.us> X-Mailer: git-send-email 1.7.12.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: c8dfb7ab-139c-4a79-8541-003375bdfd9f X-Archives-Hash: b11a88f8ed0b82126b7c948ea67e2926 From: "W. Trevor King" >From sed(1): s/regexp/replacement/ Attempt to match regexp against the pattern space. If successful, replace that portion matched with replacement. The replacement may contain the special character & to refer to that portion of the pattern space which matched, and the special escapes \1 through \9 to refer to the corresponding matching sub-expressions in the regexp. This means that the old expression (with unescaped ampersands) lead to: source /etc/profile ##STARTX##STARTX su - ${first_user} -c startx when we want: source /etc/profile && su - ${first_user} -c startx with ${first_user} expanded in both cases. --- targets/support/livecdfs-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh index 77d694e..fda3e36 100644 --- a/targets/support/livecdfs-update.sh +++ b/targets/support/livecdfs-update.sh @@ -389,7 +389,7 @@ esac if [ -e /etc/startx ] then sed -i \ - "s:##STARTX:source /etc/profile && su - ${first_user} -c startx:" \ + "s:##STARTX:source /etc/profile \&\& su - ${first_user} -c startx:" \ /root/.bashrc fi -- 1.8.2.rc0.16.g20a599e