I'm trying to write a script which will determine actions based on the architecture of the machine. I already use uname -m
to gather the architecture line, however I do not know how many ARM architectures there are, nor do I know whether one is armhf
, armel
, or arm64
.
As this is required for this script to determine whether portions of the script can be run or not, I am trying to find a simple way to determine if the architecture is armhf
, armel
or arm64
. Is there any one-liner or simple command that can be used to output either armhf
, armel
, or arm64
?
The script is specifically written for Debian and Ubuntu systems, and I am tagging as such with this in mind (it quits automatically if you aren't on one of those distros, but this could be applied in a much wider way as well if the command(s) exist)
EDIT: Recently learned that armel is dead, and arm64 software builders (PPA or virtual based) aren't the most stable. So I have a wildcard search finding arm*
and assuming armhf, but it's still necessary to figure out a one liner that returns one of the three - whether it's a Ubuntu/Debian command or a kernel call or something.