From owner-freebsd-questions Wed Sep 26 1: 7:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rush.telenordia.se (mail.telenordia.se [194.213.64.42]) by hub.freebsd.org (Postfix) with SMTP id 9DE8E37B409 for ; Wed, 26 Sep 2001 01:07:33 -0700 (PDT) Received: (qmail 3065 invoked from network); 26 Sep 2001 10:07:28 +0200 Received: from bb-62-5-36-29.bb.tninet.se (HELO there) (62.5.36.29) by mail.telenordia.se with SMTP; 26 Sep 2001 10:07:28 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Mark Rowlands To: Subject: Re: silly sed question Date: Wed, 26 Sep 2001 10:07:27 +0200 X-Mailer: KMail [version 1.3] References: <20010924115816.EE2F637B418@hub.freebsd.org> In-Reply-To: <20010924115816.EE2F637B418@hub.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20010926080733.9DE8E37B409@hub.freebsd.org> 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 Monday 24 September 2001 1:58 pm, you 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 > > ie find the line that begins with TARGETS and on that line swap the ending > single quote with blob4 and a single quote > > is what I want to write and for sed to DWIM..... > > I have tried escaping quotes in various places, double quotes and the like > but the correct incantation escapes me.......can anyone help fwiw I found another solution /^TARGETS s/.$/blob&/ -- "The only real way to look younger is not to be born so soon." -- Charles Schulz, "Things I've Had to Learn Over and Over and Over" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message