title: Sending modem AT command and parsing result
body: <p>I would like to send <code>AT</code> command to my modem by using shell script and parse the result in order to verify if the OK is returned.</p>
  
  <pre><code>at=`echo -ne "AT+CFUN1=1\r\n" &gt; /dev/ttyUSB0 | cat /dev/ttyUSB0`
  </code></pre>
  
  <p>What is the best way to parse the at1 variable and extract "OK" or "ERROR" otherwise ?</p>