Voici un petit script qui permet de tester une liaison série (avec et sans bouchon)
[bash]
#!/bin/bash
# connect.sh
# Usage:
# $ connect.sh <device> <port speed>
# Example: connect.sh /dev/ttyS0 9600
# Set up device
stty -F $1 $2 raw -echo
# Let cat read the device $1 in the background
cat $1 &
# Capture PID of background process so it’s possible to terminate it when done
bgPid=$?
# Send a string to the serial link
sleep 0.5
echo "Loop OK !!!" > $1
sleep 0.5
read -p "Press any keys…"
# Terminate background read process
kill $bgPid
[/bash]