From owner-freebsd-questions Mon Sep 24 5:41:18 2001 Delivered-To: freebsd-questions@freebsd.org Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by hub.freebsd.org (Postfix) with ESMTP id 191D737B411 for ; Mon, 24 Sep 2001 05:41:14 -0700 (PDT) Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id C68B32B728; Mon, 24 Sep 2001 14:41:07 +0200 (CEST) Received: by k7.mavetju.org (Postfix, from userid 1001) id 0AEBB3EC; Mon, 24 Sep 2001 22:40:44 +1000 (EST) Date: Mon, 24 Sep 2001 22:40:44 +1000 From: Edwin Groothuis To: Mark Rowlands Cc: freebsd-questions@FreeBSD.ORG Subject: Re: silly sed question Message-ID: <20010924224044.Q10641@k7.mavetju.org> Mail-Followup-To: Edwin Groothuis , Mark Rowlands , freebsd-questions@FreeBSD.ORG References: <20010924115816.EE2F637B418@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010924115816.EE2F637B418@hub.freebsd.org>; from mark.rowlands@minmail.net on Mon, Sep 24, 2001 at 01:58:12PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Sep 24, 2001 at 01:58:12PM +0200, Mark Rowlands wrote: > I have a string > > TARGETS='blob1 blob2 blob3' > > and I wish to use to change this to > > TARGETS='blob1 blob2 blob3 blob4' > > for a multitude of files. > > I am having problems with the quotes > > sed -e '/^TARGETS s/'$/blob4'/' myfile You should use \' here: sed -e '/^TARGETS s/\'$/blob4\'/' myfile because the ''s are part of the string, not part of the characters surrounding the string. Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: ------------------+ http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message