n8felton
9/25/2015 - 6:46 PM

Mac Model Identifier

Mac Model Identifier

hwmodel=$(sysctl -n hw.model)
hwmodel_name=$(echo ${hwmodel} | sed 's/[[:digit:]].*//')
hwmodel_num=$(echo ${hwmodel} | sed 's/[^[:digit:]]*//' | cut -d, -f1)
hwmodel_rev=$(echo ${hwmodel} | sed 's/[^[:digit:]]*//' | cut -d, -f2)