From: Gavin Sinclair Date: 2012-01-07T14:04:14+09:00 Subject: Re: one liner to insert line in a file --20cf3071d13eb3cbfe04b5e918d3 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Jan 7, 2012 at 3:07 PM, Neubyr Neubyr wrote: > 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 > > What have you tried so far? --20cf3071d13eb3cbfe04b5e918d3--