[Top][All Lists]

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

Re: Branch on sed

From: Paolo Bonzini
Subject: Re: Branch on sed
Date: Sat, 03 Oct 2009 17:53:49 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

On 10/03/2009 04:22 PM, Norihiro Tanaka wrote:

Which is correct result for the following commands, in which branch
command is included, in POSIX ?

Indeed GNU sed 4.1.0 made line number addresses are "absolute": you do not need to match the address on the exact line corresponding to the first address in order to activate it.

I don't remember exactly but POSIX either does not specify it or specifies it like GNU sed 4.1.0 and newer do. I also think that BSD sed implements it too (because I learnt about this behavior when I incorporated the BSD sed testsuite into GNU sed).

Here is another example that shows why GNU sed's behavior is preferrable:

seq 1 10 | sed -e '1,4d;3,6d'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]