From owner-freebsd-questions Sat Apr 15 0: 6:58 2000 Delivered-To: freebsd-questions@freebsd.org Received: from pluton.ispras.ru (pluton.ispras.ru [194.186.94.6]) by hub.freebsd.org (Postfix) with ESMTP id C916337BF8C for ; Sat, 15 Apr 2000 00:06:28 -0700 (PDT) (envelope-from grn@ispras.ru) Received: from gate.ispras.ru (gate [194.67.37.200]) by pluton.ispras.ru (8.9.3/8.9.3) with ESMTP id LAA24631; Sat, 15 Apr 2000 11:02:57 +0400 (MSK) Received: from ispgate (ispgate [194.67.37.200]) by gate.ispras.ru (8.9.3/8.9.3) with ESMTP id LAA27687; Sat, 15 Apr 2000 11:03:56 +0400 (MSK) Date: Sat, 15 Apr 2000 11:03:56 +0400 (MSK) From: Grigory Kljuchnikov To: Arcady Genkin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question In-Reply-To: <878zygz9z0.fsf@tea.thpoon.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG There is only one command per line in sed or several commands per line with -e option. Best regards, Grigory Klyuchnikov ------------------------------------------------------------ Institute for System Programming Russian Academy of Sciences, 109004, Moscow, Russia, B.Kommunistitcheskay, 25, phone(work): +7-095-9125659 fax: +7-095-9121524 e-mail: On 14 Apr 2000, Arcady Genkin wrote: > Dan Nelson writes: > > > > Can I specify *two* commands per line? > > > > Sure; to specify more than one command, you need to pass them with the > > -e flag: > > sed -e 's/etc/etc/' -e 's/etc/etc/' > > Oh, sorry, I meant something else. I meant two commands per _matched_ > line, not per command line. Something like: > > sed '/^Subject: / s/\[PHP3\] *//g s/\[PHP4BETA] *//g' > ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ > Command 1 Command 2 > > i.e. process every line that matches /^Subject:/, first removing any > occurences of [PHP3], then -- any occurences of [PHP4BETA]. > > The above examble gives me an error message about unknown option to > 's'. > -- > Arcady Genkin http://www.thpoon.com > Nostalgia isn't what it used to be. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message