Skip to content

Instantly share code, notes, and snippets.

@buzz
Created March 3, 2017 14:06
Show Gist options
  • Save buzz/ebe8ab51aae2999078202f538fe6dea3 to your computer and use it in GitHub Desktop.
Save buzz/ebe8ab51aae2999078202f538fe6dea3 to your computer and use it in GitHub Desktop.
lenovo-get-dmi.sh
for X in system-{manufacturer,product-name,version} \
baseboard-{manufacturer,product-name,version} \
chassis-{manufacturer,version} bios-{vendor,version,release-date}; do \
echo -n "|| `sudo /usr/sbin/dmidecode -s $X` " \
| perl -pe 's/\n/\\n/' ; done; \
sudo /usr/sbin/dmidecode | perl -0777 -ne \
'm/\n(.*).\n.*\n(.*Embedded Cont.*)\n/i; print "\n|| <nowiki>$1$2</nowiki>\n"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment