title: Grep not found when call execl
body: <p>I have here some code in C++. I want to execute the program grep in linux. When compiling, there are no errors.</p>
  
  <pre><code>com.append("grep");
  execl(com.c_str(), "-n", "-w", word.c_str(), list_files.at(i + 1).c_str(), NULL);
  </code></pre>
  
  <p>But when I execute my c++-program, there were nothing. Then I wanted to find the error with errno.</p>
  
  <p>The result was 2 and I know that this means that he couldn't find this program.</p>
  
  <p>But what should I do so I can start grep from my c++-program ?</p>