`gROOT->ProcessLineSync(".>");` is enough, no need to go via cmd.