Code: Select all
echo "a" >/dev/tty.usbmodemb21
Note, however, that the process of opening /dev/tty.xxx will cause an auto-reset sequence on most modern arduinos, essentially unavoidable. If you want to send occasional data strings to a running sketch, you'll need to disable auto-reset, or find a mac-side program that has additional capabilities (like keeping the port half open, or incorporating intelligence that allows delays and or checking for appropriate responses.)