title: Spawn child to execute command shows more files on stdout.on('data') than actually exist
body: <p>I want to zip a large directory $TMPDIR on Mac and want to track its progress. For that I am using following code:</p>
  
  <pre><code>let count = 0;
  this.shellChildProcess = spawn("cd $TMPDIR;zip -r /Documents ." , [], {shell: true});
  this.shellChildProcess.stdout.on('data', (data) =&gt; {
       const updatedObjects: number = data.toString().match(new RegExp("updating", "g")) ? data.toString().match(new RegExp("updating", "g")).length : 0;
       const addedObjects: number = data.toString().match(new RegExp("adding", "g")) ? data.toString().match(new RegExp("adding", "g")).length : 0;
       count = count + Math.max(updatedObjects + addedObjects, 1);
       console.log(data + "count: " + count);
  });
  </code></pre>
  
  <p>Partial output from this command looks like that: </p>
  
  <p><a href="https://i.stack.imgur.com/lhzZ5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lhzZ5.png" alt="enter image description here"></a></p>
  
  <p>Data is being received in chunks and i am parsing it to count files which are updated or added new in zip.</p>
  
  <p>The total files that I get in return are 120708 with the zip command while actual file count is 63708. I got actual file count using following command on shell:</p>
  
  <pre><code>find . | wc -l
  </code></pre>
  
  <p>If I execute same command using spawn child, count remains same (63708). I am unable to track progress because of such a big difference in file count. </p>