title: How to exit minicom via scripting
body: <p>I have a <a href="https://linux.die.net/man/1/runscript" rel="nofollow noreferrer">minicom script</a> which sends some commands via serial and expects something back(which works) but im having trouble exiting the minicom screen.</p>
  
  <p>Below is the minicom script:</p>
  
  <pre><code>success1:    
     print \nSuccessfully received running!
     send "exit" 
     exit 0
  
  success2:
     print \nSuccessfully received degrading!
     ! killall -9 minicom
     exit
  </code></pre>
  
  <p>I was using <code>! killall -9 minicom</code> which is recommended on their documentation but unfortunately, when running the script on Jenkins, it fails due to exit code 137 (Another process sent a signal 9). However this does exit minicom, just not successfully. </p>
  
  <p>On the other hand, the 'send "exit"' just logs out of the device, and doesnt exit minicom. </p>
  
  <p>How can i exit minicom and receive a 0 exit code? </p>