Skip to content

Instantly share code, notes, and snippets.

@Sir-Photch
Created November 9, 2022 08:11
Show Gist options
  • Save Sir-Photch/9f300b8e301a5306b3564cd3ae4ecb82 to your computer and use it in GitHub Desktop.
Save Sir-Photch/9f300b8e301a5306b3564cd3ae4ecb82 to your computer and use it in GitHub Desktop.
Loop to write ascii-text to serial port
#!/bin/sh
if [[ $# == 0 ]]; then
echo "Usage: send.sh <serial port>" >&2
exit 1
fi
echo "Writing to $1; Press Ctrl+C to exit"
echo
while :
do
read -p "> " message
echo -n "$message" > "$1"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment