1 2 3 4 5
#!/bin/bash #print cpu it is running on declare -a arr arr=( $(< /proc/self/stat) ) echo ${arr[38]}