Created
April 7, 2017 01:45
-
-
Save kamawanu/cf3ebb85ebf1bdfdaa593a3c9ac00652 to your computer and use it in GitHub Desktop.
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 -x | |
BYPATH=$( fgrep $1 /sys/bus/usb/devices/*/serial | cut -d: -f1 ) | |
DEVPATH=$( echo $BYPATH | cut -d/ -f6 | cut -d- -f2 ) | |
##ls -1 /dev/disk/by-path/pci-* | |
cd /dev/disk/by-path/ | |
realpath $( readlink pci-*:*:*-usb-*:$DEVPATH:* ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment