When I try to source 1.sh, root will be started to run A1.c, but when it’s finished, it’s stucked there and will not go to A2.c. It needs a manuall work to type ‘.q’ , how can I avoid this manual typing work? e.g. is there a way to quit ROOT automatically?
I’d suggest making a flag on the main part, and then having a check on if the flag is passed. Put an if statement for the Terminate call if the automatic flag is passed. Or if you don’t want to do flags, just make it a Bool_t for the function and call it from the shell like:
When I try to source 1.sh, root will be started to run A1.c, but when it’s finished, it’s stucked there and will not go to A2.c. It needs a manuall work to type ‘.q’ , how can I avoid this manual typing work? e.g. is there a way to quit ROOT automatically?
Thanks,Gang[/quote]
You can run root with the -q option
root -q A1.C
Will run the macro and then quit without having to change the macro.