Run bash script from qt
-
Hi everyone;
I am running the bash script from qt creator and following the code.
/@
QProcess process ;
process.startDetached("/bin/bash", QStringList() << "/home/Documents/testing/script.sh");
@/
But getting error No directory found even my directory path is correct.
thanks -
@Wasee said in Run bash script from qt:
process.startDetached("/bin/bash", QStringList() << "/home/Documents/testing/script.sh");
process.startDetached("/bin/bash", QStringList() << "-c" << "/home/Documents/testing/script.sh");
-
@Wasee said in Run bash script from qt:
process.startDetached("/bin/bash", QStringList() << "/home/Documents/testing/script.sh");
But getting error No directory found even my directory path is correct.
So you're sure that directory path is correct and exists, it isn't supposed to be
"/home/my_user_name/Documents/..."
? :) -
@Wasee said in Run bash script from qt:
/home/Documents/testing/script.sh
As @JonB said: this path looks wrong. There should be user name in it, like: /home/YOUR_USER_NAME/Documents/testing/script.sh
-
@Wasee said in Run bash script from qt:
My application crashes with ASSERT failure in QList<T>: index out of range.
Then fix your code.
You are accessing your QList outside of its bounds.
Really not hard to fix, instead of wasting time asking such basic stuff in a forum...
And do you really think you provided enough information for others to help you?
How should anybody know what list it is and how you are using it if you don't even bother to show relevant code? -
@Wasee said in Run bash script from qt:
process.startDetached("/bin/bash", QStringList() << "-c" << "/home/Documents/testing/script.sh");
QProcess::startDetached("/bin/bash", QStringList() << "-c" << QString("/home/johann/script.sh %1").arg(someParameter));
-