milli
13th March 2011, 20:45
I would like to execute shell commands using QProcess,i have searched forum and read documentation but i can't solve my problem.
For example,
cmdline="/bin/bash";
arguments << "-c" << "sudo apt-get install";
process->start(cmdline,arguments,QIODevice::ReadWrite);
The result of above program is:
sudo: no tty present and no askpass program specified
If the arguments are:
arguments << "-c" << "ls -l";
then the function is executed correctly.
i have edited sudoers file using visudo in order not to ask password for a specific user.
Thanks!
For example,
cmdline="/bin/bash";
arguments << "-c" << "sudo apt-get install";
process->start(cmdline,arguments,QIODevice::ReadWrite);
The result of above program is:
sudo: no tty present and no askpass program specified
If the arguments are:
arguments << "-c" << "ls -l";
then the function is executed correctly.
i have edited sudoers file using visudo in order not to ask password for a specific user.
Thanks!