git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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   / \
Previous: martin f krafftNext: martin f krafft
Message 8 of 11 in “Help a sed noob”
  1. Nguyen Thai Ngoc DuyAug 3, 2007
  2. Junio C HamanoAug 3, 2007
  3. Nguyen Thai Ngoc DuyAug 4, 2007
  4. René ScharfeAug 3, 2007
  5. martin f krafftAug 4, 2007
  6. Jeff KingAug 4, 2007
  7. martin f krafftAug 4, 2007
  8. Simon 'corecode' SchubertAug 4, 2007
  9. martin f krafftAug 4, 2007
  10. David KastrupAug 4, 2007
  11. Jeff KingAug 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.