Re: [ROOT] batch without script

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Thu Jan 11 2001 - 18:50:32 MET


t:
> 
> 
> Hi all,
> 
> Does anyone know if it is possible (and how) to run a ROOT batch with code
> on the command line and not in a script file?
> 
> For instance having  script.C that would contain a few lines of code like
> {
> Float_t b = 1;
> Int_t c = 2;
> cout<<b<<c<<endl;
> }
> 
> and then execute that script in a way like
> 
> root -b {Float_t b = 1;Int_t c = 2;cout<<b<<c<<endl;}
> 
> instead of
> 
> root -b script.C

   What about the script;-)

 void noScript(const char *comanndLine) {
    gROOT->ProcessLine(commandLine);
  }

 or something like this.

That one can use as follows:

 root -b 'noScript.C("{Float_t b = 1;Int_t c = 2;cout<<b<<c<<endl;}")'

  Valeri 



This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:50:53 MEST