Use root in command line only

ROOT Version: 6.14.2
Platform: CENTOS 7
Compiler: GCC 8.2.0

Hi All,

I want to run root scripts via a bash shell while providing arguents to my script

is there a way to run root/cling scripts as if i was feeding a main (int argc, char**argv) function?

example cpp

int myscript(int argc, chr ** argv) {std::cout << argv[1] << std::endl}

where i would run
root ./example.cpp printMe
and I would get the output “printMe”

my ultimate intention is to feed a csv file’s data into a TGraph and have it automagically make a png image of a chart

ROOT User’s Guide -> The C++ Interpreter Cling -> Feeding Sources Files To ROOT: C++ Scripts

Awesome, thanks wile!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.