Date: 14 Apr 2000 16:46:59 -0400 From: Arcady Genkin <a.genkin@utoronto.ca> To: freebsd-questions@FreeBSD.ORG Subject: Re: A sed question Message-ID: <878zygz9z0.fsf@tea.thpoon.com> In-Reply-To: Dan Nelson's message of "Fri, 14 Apr 2000 16:24:55 -0400" References: <87k8i0zbj8.fsf@tea.thpoon.com> <20000414152317.A1743@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Dan Nelson <dnelson@emsphone.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?878zygz9z0.fsf>
