Skip to content

Instantly share code, notes, and snippets.

@6david9
Created December 23, 2021 04:13
Show Gist options
  • Save 6david9/2763798c3f8ffaf0d7a74cfa52d3ae3c to your computer and use it in GitHub Desktop.
Save 6david9/2763798c3f8ffaf0d7a74cfa52d3ae3c to your computer and use it in GitHub Desktop.
#!/bin/zsh
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Running on Rosetta 2"
else
echo "Running on native Intel"
fi
elif [ "${arch_name}" = "arm64" ]; then
echo "Running on ARM"
else
echo "Unknown architecture: ${arch_name}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment