Skip to content

Instantly share code, notes, and snippets.

@danielhavir
Created June 29, 2018 10:21
Show Gist options
  • Save danielhavir/6a549092a9872a61cb876e7ed69c8957 to your computer and use it in GitHub Desktop.
Save danielhavir/6a549092a9872a61cb876e7ed69c8957 to your computer and use it in GitHub Desktop.
if [ $# -ne 2 ];then
echo "Usage: `basename $0` idVendor idProduct"
exit 1
fi
for X in /sys/bus/usb/devices/*; do
if [ "$1" == "$(cat "$X/idVendor" 2>/dev/null)" -a "$2" == "$(cat "$X/idProduct" 2>/dev/null)" ]
then
echo "$X"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment