Writing output of Print to a file

how can I make the output of

root [13] h1->Print(“all”)

go to a file instead of having it printed in the terminal?

Hi Andrew,
the Print function uses “printf” so the easiest way would be to compile your program running outside root(if you don’t know how to do it, let me know) and then you can call it as:

and the printed lines will be redirected to the “print.txt”

Things are even much simpler, simply do:

root [13] h1->Print("all"); >x.log or root [13] h1->Print("all"); >>x.log to append to an existing x.log
Rene