From owner-freebsd-questions Thu Feb 21 9:56:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp.bcn.isoco.net (ldap.isoco.net [212.9.90.11]) by hub.freebsd.org (Postfix) with ESMTP id D452837B42F for ; Thu, 21 Feb 2002 09:56:15 -0800 (PST) Received: from fxn.bcn.isoco.net (fxn.bcn.isoco.net [172.16.1.50]) by smtp.bcn.isoco.net (Postfix) with SMTP id 6A299CD2BB; Thu, 21 Feb 2002 18:56:14 +0100 (CET) Date: Thu, 21 Feb 2002 18:56:02 +0100 From: F.Xavier Noria To: Eric Boucher Cc: freebsd-questions@FreeBSD.org Subject: Re: Bourne shell programming problem no.2 Message-Id: <20020221185602.029912d6.fxn@isoco.com> In-Reply-To: <20020221174633.43542.qmail@web9404.mail.yahoo.com> References: <20020221174633.43542.qmail@web9404.mail.yahoo.com> X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i386--freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Thu, 21 Feb 2002 09:46:33 -0800 (PST) Eric Boucher wrote: : I have another problem while programming with the : bourne shell. I want to be able to write in a file at : a certain place. For example, if a file contain: : : AAA BBB CCC DDD. : EEE FFF GGG HHH. : III JJJ KKK LLL. : : I want to change the word "GGG" by "TTT". But "GGG" : can be anyware in the file (which I have permission to : write by the way).How do I do such a trick with the : bourne shell? If "GGG" has no newlines this could serve: perl -pi -e 's/\QGGG\E/TTT/g' -- fxn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message