Shell script execution using Qprocess
I am trying to execute a shell script using qprocess that calls another shell scripts. The problem is that the program skips any other calling to other scripts and executes the next command
The script:
Code:
#tri1 decoding
utils/mkgraph.sh data/lang_test exp/tri1 exp/tri1/graph
echo "Hi there"
The code i wrote:
Code:
program<< "-c"<<"bash /home/dell2/Desktop/ll.sh";
exec.start("/bin/sh",program);
exec.waitForFinished();
Re: Shell script execution using Qprocess
You probably have to set a working directory - setWorkingDirectory()?
Re: Shell script execution using Qprocess
Yes! That's exactly was the problem ... Thank you very much
Re: Shell script execution using Qprocess
Hi, just a small remark: you effectively call "sh -c bash /home/dell2/Desktop/ll.sh", which means that you start a shell (sh) to start a shell (bash) to run your script. One of these shells can be removed.
Ginsengelf