sed 'N; D' testfile
で期待通りに動作しないテストファイルが含まれています'N' と 'D' はsedの
this is the first line
this is the second line
this is the third line
this is the fourth line
私はRHEL 6を使用していますが、出力はとして提供されます:
私の1としてthis is the fourth line
N
は次の行をパターンスペースに引っ張り、D
はパターンスペースの最初の行だけを削除します。したがって、出力は次のようになります。
this is the second line
this is the fourth line
出力が上記のようになっている理由を説明してもらえますか? the documentationによると
..TL; DR:RTFM .. – stevesliva