title: Send Command to serial port via Cu and exit in same line
body: <p>I want to execute "sw i01" into cu command and exit cu (with "~.") </p>
  
  <p>in just one line or in file bash because il will execute them from a distant
  server</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/Qy2lH.png" alt="cu command"></p>
  </blockquote>
  
  <p>In this image i put:</p>
  
  <pre><code>cu -s 19200 -l /dev/ttyUSB0 
  </code></pre>
  
  <p>then it return "Connected."</p>
  
  <p>i put "sw i01" (command switch HDMI to input 1)</p>
  
  <p>it return "Command Ok"</p>
  
  <p>then i exit with "~."</p>
  
  <p>(the same for <strong>screen</strong> command)</p>