title: Shell script to write and read data from serial communication
body: <p>I am making a simple shell script to write and read data to serial device.
  I am using these commands at terminal and they are responding correctly:</p>
  
  <p>To write I am using:</p>
  
  <pre><code>echo -en '\xAA\x04\xC2' &gt; /dev/ttyUSB0
  </code></pre>
  
  <p>To read I am using read:</p>
  
  <pre><code>cat -v &lt; /dev/ttyUSB0
  </code></pre>
  
  <p>but when I am including this in a shell script, it is not responding. I need help regarding this.
  Also I want to know that when I send the write command, It should give me output in hex format but it is giving me output in this format M--*^NM-^H
  Also need help in this.</p>