Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] GNU find in a QProcess - exec parameter doesn't work
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 685 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sirius79
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sirius79
      wrote on last edited by
      #2

      replacing the backslash with a plus,

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

      works.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved