Skip to content

Instantly share code, notes, and snippets.

@simonjbeaumont
Created June 10, 2014 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonjbeaumont/437a10c2879aca99c0d3 to your computer and use it in GitHub Desktop.
Save simonjbeaumont/437a10c2879aca99c0d3 to your computer and use it in GitHub Desktop.
Script to check validity of subvendor ids
#!/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