title: Node.js command get error while using pgrep
body: <p>In my code, I need to check if a program is started. To do so, I have a function 'running':</p>
  
  <pre><code>function running(app, callback) {
      var arg = 'pgrep --count ' + app;
      exec( arg, function(err, stdout, stderr) {
          if (err) {
              console.log('Error:' + inspect(err) + ' ' + stderr);
              callback('0');
          } else {
              var data = '' + stdout;
              callback(data.charAt(0)); //Will be 0 only if no app is started
          }
      });
  }
  </code></pre>
  
  <p>It worked well for some times, but now I get:</p>
  
  <pre><code>Error: { [Error: Command failed: ]
  [stack]: [Getter/Setter],
  [arguments]:undefined,
  [type]: undefined,
  [message]: 'Command failed: ',
  killed: false,
  code: 1,
  signal: null }  
  </code></pre>
  
  <p>(stderr is empty)</p>
  
  <p>I don t understand why and so can t think of any solution.</p>
  
  <p>Does anyone could tell me why do I get this error?</p>