- echo "Reset your Pro Micro then hit any key to continue..."; \
- read -n 1 -s; \
- ls /dev/tty* > /tmp/2; \
- USB=`diff /tmp/1 /tmp/2 | grep '>' | sed -e 's/> //'`; \
+ echo "Reset your Pro Micro now"; \
+ while [[ -z $$USB ]]; do \
+ sleep 1; \
+ ls /dev/tty* > /tmp/2; \
+ USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
+ done; \