PORT=$(arduino-cli board list | grep dev | grep -o '^\S*') if [ -z $PORT ]; then return "Failed to find board" fi echo "$1\n" > $PORT