Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Can i put a bash scripts into Qt based application for Linux?
ex, i'm newbie in the Qt, can i put some short bash scripts to my qt app on linux as an exec? Or how to simply re-write it into qt code?
Scripts for service overload, for copying, etc
Maybe you have some manuals about it?
LeLev last edited by
It's just run a script with the terminal window? Can i hide the terminal window with these methods?
JonB last edited by
A script run as a
QProcesswill not show any terminal window.
A script run as a QProcess will not show any terminal window.
But sudo-password is require for my script
JonB last edited by JonB
That does not affect the fact that
QProcesswill not show any terminal window. And so left to its own devices is not suitable to just run
sudo ...if you want interactive password prompting.
For that you might either examine using
sudo -S, or
sudo -Aand the
SUDO_ASKPASSenvironment variable, or policy kits, or... https://unix.stackexchange.com/questions/254072/how-do-i-ask-password-by-gui-prompt-while-using-sudo-in-script covers some of the possibilities, https://www.linuxquestions.org/questions/programming-9/problem-in-launching-a-terminal-command-with-a-qt-button-787946/, others. I also posted on this matter in this forum previously at https://forum.qt.io/topic/100215/linux-run-external-process-with-requesting-password
@JonB Oh, thank you!