简体   繁体   English

如何在 MacOS 上安装“真正的”二进制文件?

[英]How do I install the “true” binary on MacOS?

I have a legacy Bash script which calls /bin/true somewhere.我有一个旧版 Bash 脚本,它在某处调用/bin/true When I run it on a MacOS system I get an error:当我在 MacOS 系统上运行它时,我得到一个错误:

/bin/true: No such file or directory

How do I install /bin/true to the system?如何将/bin/true安装到系统中? I couldn't find anything similar via brew search .我通过brew search找不到类似的东西。

It's in /usr/bin so change all references from /bin/true to true as it's reasonable to expect /usr/bin to be in the $PATH .它位于/usr/bin中,因此将所有引用从/bin/true更改为true ,因为期望/usr/bin位于$PATH中是合理的。

That or a load of tedious cross-platform conditional stuff...那或者一堆乏味的跨平台条件的东西......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM