Re: Create a bash-script that runs C-files in ROOT

From: Brett Viren <bv_at_bnl.gov>
Date: Tue, 6 Apr 2010 13:56:50 -0400


Ida Häggström <ida.haggstrom_at_radfys.umu.se> writes:

> I want to
> create a bash-script to run from my Linux teminal that calls for ROOT and
> executes the C-scripts and so on...

One more feature to consider is that you can pass arguments from the shell into your C-scripts. You just have to be a little careful to make sure that any special characters are escaped so the shell won't interpret them.

For example,

 shell> cat myscript.C
 void myscript(const char* filename) {

    TFile* f = new TFile(filename);
    //...
 }

You can pass in the file name like:

 shell> root -q myscript.C\(\"file1.root\"\)

or wrap the whole thing in single-quotes like:

 shell> root -q 'myscript.C("file1.root")'

-Brett. Received on Tue Apr 06 2010 - 19:56:55 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 07 2010 - 11:50:01 CEST