>>430
N の仕様
次の行がないときに N が実行されるとその時点で終了する
(GNU sed の man ばかり見てたから知らなかった…いい加減 info の使い方覚えないと)

しかもPOSIX仕様の場合は、残ったパターンスペースを印字せず終了する

$ printf "1234\n1234\n1234\n1234\n1234\n" | sed --posix -e 'N;s/23/__/1'
1__4
1234
1__4
1234

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
> If no next line of input is available, the N command verb shall
> branch to the end of the script and quit without starting a new
> cycle or copying the pattern space to standard output.