#!/bin/bash # An alternative to cu or minicom for running a serial terminal such # that CTRL-C terminates this script instead of sending BREAK over the # line. Just create a symbolic link to set the port. [ -z "$2" ] && echo "usage: $0 " && exit 1 TTY=$1 # TTY=/dev/ttyUSB0 MOI=`tty` BAUD=$2 # commands # set serial tty and current tty to raw, and connect them via nullmodem MODE="raw -echo" # MODE=sane SOCAT_TTY=$TTY,raw,echo=0,cr,igncr=1,ixon=1,b$BAUD,cr3 here () { exec socat $SOCAT_TTY \ READLINE,history=$HOME/.flashforth_history } pipe () { exec socat $SOCAT_TTY - } term () { exec $TERM -e $0 here } ## Run on this terminal here ## Run in xterm # term