title: execute a shell command in nodejs
body: <p>Am trying to execute following shell command in nodejs script.it is working fine in terminal</p>
  
  <pre><code>    find -type f -printf %T+\t%p\n | sort -n
  </code></pre>
  
  <p>node script</p>
  
  <pre><code> var command = ' cd ~/home'
                command +=' find -type f -printf %T+\t%p\n | sort -n'
          exec(command, function (error, stdout, stderr) {       
  
  
      });
  </code></pre>
  
  <p>while executing the above code am getting</p>
  
  <pre><code>exec error: Error: Command failed: /bin/sh: 2: Syntax error: "|" unexpected
  </code></pre>
  
  <p>How can i solve this eroor</p>