From: Neubyr Neubyr Date: 2012-01-07T13:07:01+09:00 Subject: one liner to insert line in a file Can someone help to come up with Ruby one-liner to add a line at the beginning of a file? Basically a Ruby equivalent for following sed example- $ sed -i "1i $variable" file.txt --neubyr -- Posted via http://www.ruby-forum.com/.