davideaves.com

Live in a world of your own, but always welcome visitors.

View on GitHub
9 January 2015

Create screen session to all ttyUSB devices

by deaves

The following one-liner will create a new window for each /dev/ttyUSB port connected to the system. Assuming you’re in the dialout group. :)

for g in `groups`
 do [ "$g" == "dialout" ] &&
        {
          for TTY in /dev/ttyUSB*
           do TERM=`basename $TTY`
                screen -t "$TERM" $TTY 9600,-ixoff,-ixon || screen -s "$TERM"
           done
        }
done
tags: