There's currently no way to modify the Julia's STDOUT descriptor dynamically (there was a mailing list thread about this somewhere, although I don't think this even makes sense inside the REPL), but you can always save the output of any command to a file:
run(`echo $(sqrt(5))` > "/tmp/tmp")
or the slightly uglier,
open(fid->write(fid,"$(sqrt(5))\n"), "/tmp/tmp", "w")