Results 1 to 3 of 3

Thread: QProcess unable to start shell commands linux

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Greece
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    15

    Default QProcess unable to start shell commands linux

    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!
    Last edited by milli; 13th March 2011 at 21:54.

Similar Threads

  1. Replies: 12
    Last Post: 11th September 2010, 02:39
  2. QProcess: how to run shell script with password?
    By cutie.monkey in forum Qt Programming
    Replies: 0
    Last Post: 23rd March 2010, 06:43
  3. Shell command from Qt 4.5.2 by QProcess
    By Rajeshsan in forum Newbie
    Replies: 5
    Last Post: 21st December 2009, 17:03
  4. QProcess & linux shell characters
    By Ti_Thom in forum Qt Programming
    Replies: 4
    Last Post: 21st December 2009, 11:01
  5. qprocess and shell
    By GuL in forum Qt Programming
    Replies: 1
    Last Post: 12th February 2009, 06:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.