2011-05-06 [Linux] sedで複数行の置換 Nコマンドを使う $ cat test.txt hoge fuga piyo$ sed -e "/hoge/{ N s/hoge\nfuga/foo\nbar/ } " test.txt foo bar piyo