Batch Mode : Compiles but doesn't run

I tried running the code given below from inside a shell script, apparently couldn’t:

ROOT version : 6.05

#include <iostream>
using namespace std; 
void testRoot(){
int i=0;    
        do{
    
                cout << i << endl;
                i++;

        }while(i!=10);
}

Passed onto a script in bash

#!/bin/bash
        export ROOTSYS=$HOME/root 
        export PATH=$PATH:$ROOTSYS/bin 

        for i in {0..10}
        do
                root -b -q testROOT.C >> output
        done

ran it, but saw a message that looks like this :

warning: cannot find function 'testROOT()'; falling back to .L

Just figured out that the name of the program at commandline was given as testROOT.C instead of testRoot.C. Works perfectly :smiley:

Good. Removing it from unanswered posts.

It would be better if you removed such spurious threads completely.