[bash]CPUでの処理分岐
#!/bin/bash
###
ARCHITEC=$(/usr/bin/arch)
if [ "$ARCHITEC" == "arm64" ]; then
/bin/echo "arch:" "ARM"
else
/bin/echo "arch:" "INTEL"
fi
##########################################
UNAME=$(/usr/bin/uname -m)
if [ "$UNAME" == "arm64" ]; then
/bin/echo "uname" "ARM arm64"
elif [ "$UNAME" == "x86_64" ];then
/bin/echo "uname" "INTEL x86_64"
fi
##########################################
CPUTYPE=$(/usr/sbin/sysctl -n hw.cputype)
if [ "$CPUTYPE" == "16777228" ]; then
/bin/echo "hw.cputype:" "ARM"
elif [ "$CPUTYPE" == "16777223" ];then
/bin/echo "hw.cputype:" "INTEL"
fi
| 固定リンク
「Admin Device Management」カテゴリの記事
- デバイスUUIDの取得(2024.11.11)
- モデル名を取得する(2024.05.17)
- TB Default Item Identifiers(com.apple.finder.plist)(2023.12.22)
- [profiles] profiles コマンド書き出したバックアップを各ファイルに書き出す(2023.11.12)
- [profiles]現在のユーザー・プロファイル設定をバックアップ(2023.10.31)