Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gcc -march=native -Q --help=target|grep march
- -march= bdver1
- [root@mediasrv ~]# dmidecode|grep -i intel
- Socket Designation: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
- Manufacturer: Intel
- Version: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
- $ ./intel_codename
- Processor name: i7-7700HQ
- Kaby Lake
- #!/bin/bash
- set -euo pipefail
- if [[ $# == 0 ]]; then
- modelname=$(cat /proc/cpuinfo | grep 'model name' | head -1)
- if ! grep Intel <<<"$modelname" > /dev/null; then
- echo "You don't seem to have an Intel processor" >&2
- exit 1
- fi
- name=$(sed 's/.*s(S*) CPU.*/1/' <<<"$modelname")
- echo "Processor name: $name" >&2
- else
- name=$1
- fi
- links=($(curl --silent "https://ark.intel.com/search?q=$name" | pup '.result-title a attr{href}'))
- results=${#links[@]}
- if [[ $results == 0 ]]; then
- echo "No results found" >&2
- exit 1
- fi
- link=${links[0]}
- if [[ $results != 1 ]]; then
- echo "Warning: $results results found" >&2
- echo "Using: $link" >&2
- fi
- url="https://ark.intel.com$link"
- codename=$(curl --silent "$url" | pup '.CodeNameText .value text{}' | xargs | sed 's/Products formerly //')
- echo "$codename"
Add Comment
Please, Sign In to add comment