Created
August 7, 2016 16:28
-
-
Save ScottHelme/e793516d2b322ed3a4c795a429eb5d04 to your computer and use it in GitHub Desktop.
Find dev path of USB GPS device.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do | |
( | |
syspath="${sysdevpath%/dev}" | |
devname="$(udevadm info -q name -p $syspath)" | |
[[ "$devname" == "bus/"* ]] && continue | |
eval "$(udevadm info -q property --export -p $syspath)" | |
[[ -z "$ID_SERIAL" ]] && continue | |
echo "/dev/$devname - $ID_SERIAL" | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment