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

From: Brett Viren <bv_at_bnl.gov>
Date: Wed, 7 Apr 2010 11:29:10 -0400


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

> --------------------------------------
> for (j=0;j<=$N,j++)
> do
>    cd folder$j
>    root -q -b myScript1.C("rootFile_$j") myScript2.C
>    cd ..
> done
> --------------------------------------

Are you using pseudo-code in this example? Because it is not valid shell (bash) code. Try cut-and-pasting this to a file "loop.sh":



#!/bin/bash
for file in $*
do

    root -l -q -b myScript1.C\(\"$file\"\) myScript2.C done


You would then run it by giving one or more files on the command line:

shell> ./loop.sh /path/to/data/rootFile_1.root \
                 /path/to/data/rootFile_2.root \
                 /path/to/data/rootFile_3.root \
                 /path/to/data/rootFile_4.root 
(etc) Received on Wed Apr 07 2010 - 17:29:15 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 07 2010 - 17:50:02 CEST