MacOSXのsedでappend
ぐぐってもman読んでもすぐわからなかった
macのsedではどう書くか
1行目のすぐ下に挿入したい場合:
$ echo "aaa" > foo.txt $ echo "bbb" >> foo.txt $ sed -i '' -e '1 a\ hogehoge' foo.txt $ cat foo.txt aaa hogehoge bbb
OSX の sedのappendは難しいということがわかりました / “sed on OSX insert at a certain line - Unix & Linux Stack Exchange” http://t.co/8AeNyAetZo
— ほしの hoshinotsuyoshi (@hoppiestar) 2014, 12月 18
@hoppiestar brewでgnu-sed入れてgsed使うのが楽ですよね。
— Takashi Masuda (@masutaka) 2014, 12月 18