Re: Help a sed noob
- From
Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
- Date
- Aug 4, 2007, 12:26 UTC
- Message-ID
- <46B4705D.2010208@fs.ei.tum.de>
- In-Reply-To
- <20070804121811.GA1605@lapse.madduck.net>
martin f krafft wrote:
Show 5 quoted lines
> also sprach Jeff King <peff@peff.net> [2007.08.04.1350 +0200]: >> No, it prints everything _except_ "URL: *" from the first matching line. > > I am convinced we could submit this to the Obfuscated Code Contest. > :)
This is basic sed scripting.
> The behaviour is absolutely unclear from the manpage and defies my > logic. Can you elaborate a bit, even though this is off-topic?
-ne means "don't print, execute the following code".
/.../ should be clear, { starts a "function list" s// is "match last regexp, so s/// is "match last regexp and replace with empty string. flag "p" to function "s" means "print if matched" q is "quit".
that's really straight forward and all documented in my sed(1).
cheers simon
-- Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\ Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ / Party Enjoy Relax | http://dragonflybsd.org Against HTML \ Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \