Humanity

Edit the world by your favorite way

vi

ある文字列をファイルの特定行に挿入するコマンド 〜Vim編〜

ある文字列をファイルの特定行に挿入するコマンド - 元RX-7乗りの適当な日々 元記事はこちら。 元ファイル $ cat test.txt line1 line2 line3 2行目に挿入 $ vim -u NONE -i NONE -c "2put! ='hoge'" -c wq test.txt $ cat test.txt line1 hoge line2 line3 …