Created
June 10, 2014 16:13
-
-
Save simonjbeaumont/437a10c2879aca99c0d3 to your computer and use it in GitHub Desktop.
Script to check validity of subvendor ids
This file contains hidden or 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 | |
SUBVENDOR_IDS=$(grep -P '^\t\t[0-9a-f]{4}' /usr/share/hwdata/pci.ids | cut -d' ' -f1 | tr -d '\t' | sort -u) | |
VENDORS=$(grep -P '^[0-9a-f]{4}' /usr/share/hwdata/pci.ids) | |
VENDOR_IDS=$(grep -P '^[0-9a-f]{4}' /usr/share/hwdata/pci.ids | cut -d' ' -f 1) | |
for svid in $SUBVENDOR_IDS; do | |
if [ $(echo "$VENDOR_IDS" | grep $svid) ]; then | |
echo "Found $svid" | |
else | |
echo "Not found $svid" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment