Using a macro from the command line

From: Rosciano Fabio <fabio.rosciano_at_psi.ch>
Date: Wed, 20 Sep 2006 11:41:18 +0200


Hello there list,

I am new to ROOT and I am learning its working. I have to treat various datasets using a function defined in a .C macro.

My macro works beautifully by starting ROOT, loading the macro and calling the function defined in the macro:

$ root

root> .L mymacro.C+
root> ini()
root> myfunction(value,value,value)

What I'd like to do now is to call all these commands from a single command line so that it can be used in bash scripts and such. I have read in the manual that

$ root -b -l (myfunction)

is the way to go, and that the best way to load my macro at startup is setting it up in the .rootrc file. If I do that, the macro gets loaded, but using .x instead of .L.

Can you point me in the right direction about this? How can I include all three commands I give in ROOT in the non interactive mode?

Thank you for your help!

-- 
Best Regards, Fabio
OVGA 110
Paul Scherrer Institut
CH - 5232 Villigen PSI
+41563105426
Received on Wed Sep 20 2006 - 11:41:30 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET