Shell one liner to prepend to a file
This still uses a temp file, but at least it is on one line:
echo "text" | cat - yourfile > /tmp/out && mv /tmp/out yourfile
Credit: BASH: Prepend A Text / Lines To a File
echo '0a
your text here
.
w' | ed some_file
ed is the Standard Editor! http://www.gnu.org/fun/jokes/ed.msg.html