Hi,
[...]
std::string _script = "bashScript.sh &"; std::string _shell = "/bin/sh";
int main() { cout << "!!!Hello World!!!" << endl; // call the script std::string cmd = _shell + " " + _script + " " + "Node A" + " " + "/home/s116793/something"; cout << "The cmd is:"<<cmd<<endl; ::system(cmd.c_str()); return 0; }
You are executing: `/bin/sh bashScript.sh & Node A /home/s116793 something`
This means: You are executing: -- `/bin/sh bashScript.sh` (runs as background process, (the '&')) -- `Node A ...`
[...]
Output
!!!Hello World!!! The cmd is:/bin/sh bashScript.sh & Node A /home/s116793/something sh: 1: Node: not found /bin/sh: 0: Can't open bashScript.sh
what you want is: `/bin/sh bashScript.sh Node A... &`.
`man bash` might help ;)
Best regards, Stephan