[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GUN Sed Bug
From: |
Eric Blake |
Subject: |
Re: GUN Sed Bug |
Date: |
Fri, 26 Oct 2012 15:06:31 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 |
On 10/26/2012 06:42 AM, 王森 wrote:
> address@hidden learn_sed]# /bin/sed "s/\'/ End/" tmp.txt
> hello world End
> I'am in china End
> address@hidden learn_sed]#
> ### My Question
> I want to know the reason. \' be equal to Line End ?
Thanks for the report. However, this is not a bug, but a GNU extension,
as documented here:
https://www.gnu.org/software/sed/manual/html_node/Escapes.html#Escapes
In your particular case, end of line and end of input happen to match.
But if your sed script had also used commands like 'N', then you could
see a difference where multi-line mode makes \' match fewer places than $.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- GUN Sed Bug, 王森, 2012/10/26
- Re: GUN Sed Bug,
Eric Blake <=