[SOLVED] GNU find in a QProcess - exec parameter doesn't work



  • I'm running GNU find in a QProcess which works just fine.
    Nevertheless, when I try to combine it with grep, it does not execute at all.

    The QProcess is started with

    @process->start(findpattern.replace("~",QDir::home().absolutePath()), QProcess::Unbuffered | QProcess::ReadWrite);@

    When findpattern is e.g.

    @find "~/Downloads" -name "*.cpp"@

    this works just fine. But for e.g. finding all cpp files that contain "else"

    @find "~/Downloads" -name "*.cpp" -exec grep -l "else" {} ;@

    it fails

    What am I doing wrong?



  • replacing the backslash with a plus,

    containingTextString = QString("-exec grep -l "").append(arg1).append("" {} +;");

    works.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.