In bash, to detect irrespective of whether a command COMMAND is readily available, the subsequent assertion shall be executed. (Be aware that I configured bash to be the default shell, alternatively of zsh.)
form COMMAND...
For instance, kind
detects that the command cp
is obtainable and that the command foo
is unavailable.
$ type cp
cp is /bin/cp
$ kind foo
-bash: form: foo: not discovered
Note that you can move two or far more commands to variety
.
$ type cp foo
cp is /bin/cp
-bash: type: foo: not discovered
On the other hand, variety
is useless to detect the real availability of instructions SetFile
and GetFileInfo
, that is, to detect whether SetFile
and GetFileInfo
are actually usable.
SetFile
and GetFileInfo
belong to Commandline Developer Tools for Xcode. macOS 12 Monterey does not quickly occur with Xcode nor Commandline Developer Resources. Hence, SetFile
and GetFileInfo
are supposed to be unavailable if neither Xcode nor Commandline Developer Resources is mounted. Consequently, I expected type SetFile GetFileInfo
to deny their availability. On the contrary, sort
affirmed their availability.
$ variety SetFile GetFileInfo
SetFile is /usr/bin/SetFile
GetFileInfo is /usr/bin/GetFileInfo
Then, I executed SetFile
and GetFileInfo
in Terminal. Having said that, macOS complained that SetFile
and GetFileInfo
had been unusable.
The "SetFile" command needs the command line developer tools.
Would you like to put in the instruments now?
The "GetFileInfo" command involves the command line developer resources.
Would you like to put in the applications now?
These error messages were being not shown in Terminal but a GUI dialog box popped up in the desktop outside Terminal, asking the consumer to click either the “Set up” or “Terminate” button.
How can the legitimate availability of SetFile
and GetFileInfo
be examined quietly without triggering any consumer interaction?
Permit me ask some additional questions connected to this above problem. On 1 situation, I clicked the “Install” button to enable the Commandline Developer Instruments (CLDT) be mounted. I believed that the Commandline Developer Equipment (CLDT) would be mounted into “/Programs/Xcode.app”. Nonetheless, the set up of CLDT neither created the listing “/Apps/Xcode.app” nor mounted CLDT into it. The place was CLDT installed to?
Comparing prior to and just after the set up of CLDT, has the binary file “/usr/bin/SetFile” modified?
I speculated that “/usr/bin/SetFile” depended on a library or framework from CLDT. If this is the case, where is the CLDT library or framework?
More Stories
Attaining A Suitable Golfing Swing
Tried Playing Online Rummy? Now Is The Right Time To Get Started!
5 Benefits That You Can Enjoy by Playing Poker