Results 1 to 2 of 2

Thread: Bash command

  1. #1
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Bash command

    Trying to execute:
    Qt Code:
    1. xprop -id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{print $5}'` | grep "WM_CLASS(STRING)" | sed -e 's/.*= "\([^"]*\)".*/\1/'
    To copy to clipboard, switch view to plain text mode 
    with the code:
    Qt Code:
    1. sh.setProcessChannelMode(QProcess::MergedChannels);
    2. sh.start("xprop -id `xprop -root | grep \"_NET_ACTIVE_WINDOW(WINDOW)\" | awk \'{print $5}\'` | "
    3. "grep \"WM_CLASS(STRING)\" | sed -e \'s/.*= \"\\([^\"]*\\)\".*/\\1/\'");
    4. ...
    To copy to clipboard, switch view to plain text mode 
    but what i get is:
    Qt Code:
    1. xprop: error: Invalid window id format: `xprop.
    To copy to clipboard, switch view to plain text mode 
    What did i forget to do?
    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bash command

    QProcess does not support such features. Substitution and piping is part of the command processor bash.

Similar Threads

  1. Replies: 4
    Last Post: 14th July 2009, 03:27
  2. QMAKE run bash command
    By kemp in forum Qt Programming
    Replies: 8
    Last Post: 9th February 2007, 15:35
  3. Linux/Bash: Run a command as another user
    By sunil.thaha in forum General Discussion
    Replies: 1
    Last Post: 5th December 2006, 09:49
  4. call bash/terminal command with QT
    By myta212 in forum Newbie
    Replies: 1
    Last Post: 13th November 2006, 15:38
  5. Bash to c++/QT
    By soldstatic in forum Qt Programming
    Replies: 1
    Last Post: 26th June 2006, 20:30

Tags for this Thread

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.