Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linux Sed Bug

3 views
Skip to first unread message

王森

unread,
Oct 26, 2012, 8:33:36 AM10/26/12
to bug-gn...@gnu.org
Hi

### tmp.txt ###
[root@localhost learn_sed]# cat tmp.txt
hello world
I'am in china
[root@localhost learn_sed]#

[root@localhost learn_sed]# sed --version
GNU sed version 4.2.1

[root@localhost learn_sed]# sed 's/$/ End/' tmp.txt
hello world End
I'am in china End
[root@localhost learn_sed]#
[root@localhost learn_sed]#
[root@localhost learn_sed]# sed "s/\'/ End/" tmp.txt
hello world End
I'am in china End
[root@localhost learn_sed]#

### My Question
I want to know the reason. \' be equal to Line End ??
If possible , tell me why ? thanks

John Cowan

unread,
Oct 26, 2012, 3:04:37 PM10/26/12
to 王森, bug-gn...@gnu.org
王森 scripsit:

> I want to know the reason. \' be equal to Line End ??
> If possible , tell me why ? thanks

I confirm this behavior in sed 4.2.1 on both Linux and Cygwin.

--
Go, and never darken my towels again! John Cowan
--Rufus T. Firefly http://ccil.org/~cowan

Eric Blake

unread,
Oct 26, 2012, 5:07:52 PM10/26/12
to John Cowan, bug-gn...@gnu.org, 王森
On 10/26/2012 01:04 PM, John Cowan wrote:
> 王森 scripsit:
>
>> I want to know the reason. \' be equal to Line End ??
>> If possible , tell me why ? thanks
>
> I confirm this behavior in sed 4.2.1 on both Linux and Cygwin.

And that is to be expected, since it is documented behavior.

--
Eric Blake ebl...@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org

signature.asc
0 new messages