Today I learned that (TILT) I can use xargs and $() to send the output of one command line app to be used as the parameters of the next.
For some reason, I needed the version of make
on my macOS. A quick trip to Terminal.app
and make --version
spits out the required information. But wait, what was this in the corner?
This program built for i386-apple-darwin11.3.0.
So was make
an intel binary? file
can be used to determine the binary architecture but what was the path to make
? Fiddling through the man pages showed me that whence -pa
1 will find all copies (excluding aliases) of make
in my PATH
.
whence -pa make | xargs file
or
file $(whence -pa make)
Output:
/usr/bin/make: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/make (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/make (for architecture arm64e): Mach-O 64-bit executable arm64e
So make
is a universal binary.
Footnotes
-
I found that
which -pa
works the same aswhence -pa
but thewhich
man page does not have-p
as an option. ↩