I'm trying to check if a machine is a ThinkPad or not using something like this:
sudo dmidecode | grep ThinkPad
I want the end result return true or false (or 1/0).
I'm thinking the solution might be something like this:
sudo dmidecode | grep -c ThinkPad | test xargs -gt 0
But I'm not sure how to properly use xargs
here.
if...then...else
you're using&&
and||
. – don_crissti Apr 17 '17 at 13:14