tio/examples/socket/bidir_cmd_helper.sh
yabu76 c25a379fbb Add some socket examples of bidirectional command helpers and pexpect
bidir_cmd_herlper.sh: Bidirectional command helper by socat.
bidir_cmd_helper.py: Bidirectional command helper by python and netcat.

pexpect-ping.py, pexpect-pong.py: Scripts for throwing Ping-Pong between
cross-connected tios.
2025-12-07 11:21:55 +09:00

15 lines
332 B
Bash
Executable file

#!/bin/sh
if [ $# -lt 2 ]; then
echo "Usage: $0 <socket-path> <bidirectional-command>"
echo "Example: $0 /tmp/tio-socket0 \"sz -b -p sample.bin\""
echo "Note: Please run \"tio -S <socket-path> <your-serial-device>\" beforehand."
exit 1
fi
SOCKET_PATH=$1
BIDIR_CMD=$2
socat EXEC:"$BIDIR_CMD" $SOCKET_PATH
exit $?