title: Send multiple commands in series using shell.exec
body: <p>I am attempting to send AT commands to a USB device in Node.js using <em>shelljs</em> and <strong>socat</strong>.</p>
  
  <p>The following (2) commands executes successfully in <em>Terminal</em>:</p>
  
  <pre><code>$ sudo socat - /dev/ttyUSB0
  AT+RESTART
  </code></pre>
  
  <p>Note: The first command connects to the device, and the second restarts it.</p>
  
  <p>However, the following (2) commands do not execute successfully in <em>Node.js</em>:</p>
  
  <pre><code>shell.exec('sudo socat - /dev/ttyUSB0');
  shell.exec('AT+RESTART');
  </code></pre>
  
  <p>How do I get the two commands to run in the same shell.exec instance?</p>