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

Re: Help a sed noob

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 4, 2007, 00:06 UTC
Message-ID
<fcaeb9bf0708031706o3e3f4839t39eca4b64b0aab5d@mail.gmail.com>
In-Reply-To
<7vhcngkx38.fsf@assigned-by-dhcp.cox.net>
Great! Thank you both.
On 8/3/07, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> "Nguyen Thai Ngoc Duy" <pclouds@gmail.com> writes:
>
> > There is a construct like this in git-parse-remote.sh which makes
> > busybox ash unhappy:
> >
> >                 sed -ne '/^URL: */{
> >                         s///p
> >                         q
> >                 }' "$GIT_DIR/remotes/$1"
> >
> > It complains about "no previous regexp" while gnu sed is ok. Can
> > anyone explain to me what does "s///p" do? GNU Sed info page says
> > nothing about empty regexp. If I replace it with "s/\(.*\)/\1/p" then
> > I get "URL: " along with the remote path.
>
> Traditionally empty LHS regexp means "the same as last match".
> Replace it with "s/^URL: *//p" and you would be Ok.
>
>
-- 
Duy
Previous: Junio C HamanoNext: René Scharfe
Message 3 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.