My Bash Script:
#!/bin/bash
cd dataset/
root
.x Pushkar_Soni.cpp
What I am trying to do is:
1) launch root by command root
2) Inside the launched program root I want to run scripts .x Pushkar_Soni.cpp
But what happening is my last command .x Pushkar_Soni.cpp is executed after I quit root by the command .q, I want my last command to run Inside the program root
Pushkars-MacBook-Air:Pushkar_Soni pushkarsoni$ bash ./build.sh
------------------------------------------------------------
| Welcome to ROOT 6.17/01 https://root.cern |
| (c) 1995-2019, The ROOT Team |
| Built for macosx64 on Mar 18 2019, 16:04:57 |
| From heads/master@v6-16-00-rc1-1322-gf3f829884a |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0] .q
./build.sh: line 4: .x: command not found
Pushkars-MacBook-Air:Pushkar_Soni pushkarsoni$
roots man page, its signature is "root [options] files", meaning you should be able to just sayroot Pushkar_Soni.cppinstead of the last two lines in your script.