From owner-freebsd-questions Fri Apr 14 13:47: 2 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail2.rdc3.on.home.com (mail2.rdc3.on.home.com [24.2.9.41]) by hub.freebsd.org (Postfix) with ESMTP id 31C4C37B749 for ; Fri, 14 Apr 2000 13:47:00 -0700 (PDT) (envelope-from antipode@thpoon.com) Received: from tea.thpoon.com ([24.114.152.71]) by mail2.rdc3.on.home.com (InterMail vM.4.01.02.00 201-229-116) with ESMTP id <20000414204659.FXUK910.mail2.rdc3.on.home.com@tea.thpoon.com> for ; Fri, 14 Apr 2000 13:46:59 -0700 Received: from antipode by tea.thpoon.com with local (Exim 3.12 #1 (Debian)) id 12gCzT-0008L2-00 for ; Fri, 14 Apr 2000 16:46:59 -0400 To: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question References: <87k8i0zbj8.fsf@tea.thpoon.com> <20000414152317.A1743@dan.emsphone.com> X-Face: 0=A/O5-+sE[Tf%X>rYr?Y5LD4,:^'jaJ!4jC&UR*ZrrK2>^`g22Qeb]!:d;}2YJ|Hq"LHdF OX`jWX|AT-WVFQ(TPhFVak)0nt$aEdlOq=1~D,:\z5QlVOrZ2(H,mKg=Xr|'VlHA="r Organization: thpoon.com From: Arcady Genkin Date: 14 Apr 2000 16:46:59 -0400 In-Reply-To: Dan Nelson's message of "Fri, 14 Apr 2000 16:24:55 -0400" Message-ID: <878zygz9z0.fsf@tea.thpoon.com> Lines: 23 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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