Files
mastering-unix-ss/chapter23/function_get_arch
Fabio Scotto di Santolo 4cc88d2f6e initial commit
2020-07-28 19:28:25 +02:00

17 lines
303 B
Plaintext
Executable File

get_arch ()
{
# Query the system for the hardware architecture. Newer
# machines use the -M switch and the older Micro-Channel
# architecture (MCA) machines use the -p option for
# the "uname" command.
ARCH=$(uname -M)
if [[ -z "$ARCH" && "$ARCH" = '' ]]
then
ARCH=$(uname -p)
fi
echo "$ARCH"
}