Re: Help a sed noob

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Nguyen Thai Ngoc Duy" <pclouds@xxxxxxxxx> 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.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux