Created
February 18, 2015 07:35
-
-
Save usaturn/9b18c7ed2b223caba402 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CPU Affinityの設定する時に確認用の表を出力したいんだけど誰かawkだけでまとめて! | |
awk 'BEGIN{FS=":"} /(processor|physical id|core id)/{print $1,$2}' /proc/cpuinfo | perl -pe 's/(processor|physical)[^\d]+(\d{1,})\n/\1\t\2\t/g' |
awk -F':' '/processor/{printf "%s\t%d\t",$1,$2}/physical id/{printf "%s\t%d\t",$1,$2}/core id/{printf "%s\t%d\n",$1,$2}' /proc/cpuinfo
完全にスルーしてた
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こうですかワカリマセン><
awk -F':' '{if(/processor/){printf "processor\t%d\t",$2}if(/physical id/){printf "physical id\t%d\t",$2}if(/core id/){printf "core id\t%d\n",$2}}' /proc/cpuinfo