Subject: one liner to insert line in a file
From: Neubyr Neubyr <neubyr@ a . m
Date: Sat, 7 Jan 2012 13:07:01 +0900
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/.