Exit root from cc script

When calling

root -l script.cc

I would like include a command in script.cc to exit root, equivalent as if

.q

was called. How to do it?
The purpose is to run on script.cc in a batch mode.

Please provide the following information:


ROOT Version (e.g. 6.12/02):
Platform, compiler (e.g. CentOS 7.3, gcc6.2):


Here it is: gSystem->Exit(0);

1 Like

You could also just run your script without modifications with root -b -q script.cc.

1 Like

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