Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save petergi/cb2c5384876f28c21fba399db6b793e3 to your computer and use it in GitHub Desktop.
Save petergi/cb2c5384876f28c21fba399db6b793e3 to your computer and use it in GitHub Desktop.
#!/bin/bash
model=$(system_profiler SPHardwareDataType | awk '/Model Identifier/ { print $3 }')
# use grep to find the model in the list, then delete from ) to end of line
modelname=`grep $model $DIR/Models.txt | sed -e 's/).*/)/g'`
echo $modelname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment