Solved Can i put a bash scripts into Qt based application for Linux?
-
Hi,
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? -
-
It's just run a script with the terminal window? Can i hide the terminal window with these methods?
-
@YtreioJ
A script run as aQProcess
will not show any terminal window. -
@JonB said in Can i put a bash scripts into Qt based application for Linux?:
@YtreioJ
A script run as a QProcess will not show any terminal window.But sudo-password is require for my script
-
@YtreioJ
That does not affect the fact thatQProcess
will not show any terminal window. And so left to its own devices is not suitable to just runsudo ...
if you want interactive password prompting.For that you might either examine using
sudo -S
, orsudo -A
and theSUDO_ASKPASS
environment 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!