title: How to send a sequence of AT commands to a serial port in bash?
body: <p>In Linux I need to send a sequence of AT commands to a serial port on e.g. <code>/dev/ttyS0</code>, which has to wait for an <code>OK</code> answer before the next command is sent. I could imagine doing something like</p>
  
  <pre><code>echo 'AT' &gt; /dev/ttyS0
  echo 'ATS0=0' &gt; dev/ttyS0
  ...
  </code></pre>
  
  <p>but this does not evaluate the answer from the device on that port. </p>
  
  <p>Is there a <em>very</em> simple way to <strong>automate</strong> this within a bash script, probably with the help of <code>socat</code> and/or <code>microcom</code> <strong>but no tools which cannot found on the most simple linux system</strong>.</p>