bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sed ;N; reads input into core


From: Paolo Bonzini
Subject: Re: sed ;N; reads input into core
Date: Fri, 18 Mar 2005 08:54:43 +0100
User-agent: Mozilla Thunderbird 0.9 (Macintosh/20041103)

but that does not work on even/odd line pairs:

echo -e 'a\nb\nx\na\nb\nx\na\nb' | sed ';N;s/a\nb/c/g'

You need a "sliding window" technique:

N
s/a\nb/c/g
/\n/!N
P
D

Paolo




reply via email to

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