Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save petergi/f738d23537409dc759b59c9ffcc6c153 to your computer and use it in GitHub Desktop.
Save petergi/f738d23537409dc759b59c9ffcc6c153 to your computer and use it in GitHub Desktop.
#!/bin/bash
cpu=$(sysctl -n machdep.cpu.brand_string)
# removes (R) and (TM) from the CPU name so it fits in a standard 80 window
cpu=$(echo "$cpu" | awk '$1=$1' | sed 's/([A-Z]\{1,2\})//g')
echo "$cpu"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment