bash - 如何使用命令行检查是否安装了 c-blosc?
问题描述
command -v c-blosc
即使已安装,使用也不会返回任何内容
c-blosc 将自己描述为一个压缩库,所以它不是一个命令
我尝试过的几件事
% c-blosc
zsh: command not found: c-blosc
where c-blosc
c-blosc not found
brew install c-blosc
...
Warning: c-blosc 1.21.0 is already installed and up-to-date.
To reinstall 1.21.0, run:
brew reinstall c-blosc
% brew info c-blosc
c-blosc: stable 1.21.0 (bottled)
Blocking, shuffling and loss-less compression library
https://blosc.org/
/usr/local/Cellar/c-blosc/1.21.0 (10 files, 1.7MB) *
Poured from bottle on 2021-07-07 at 23:44:40
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/c-blosc.rb
License: BSD-3-Clause
==> Dependencies
Build: cmake ✘
==> Analytics
install: 312 (30 days), 1,190 (90 days), 3,168 (365 days)
install-on-request: 249 (30 days), 998 (90 days), 2,263 (365 days)
build-error: 0 (30 days)
brew search c-blosc
==> Formulae
c-blosc ✔
以下
if [ brew info c-blosc 2>&1 >/dev/null ]; then
echo "Installed"
else
echo "Nope"
fi
和
if [ brew search c-blosc 2>&1 >/dev/null ]; then
echo "Installed"
else
echo "Nope"
fi
Nope
即使我安装了它也打印
解决方案
根据https://apple.stackexchange.com/q/145437,您可以这样做
brew info c-blosc
除其他外,这将打印安装位置。您可以使用相关命令,例如search
:
brew search c-blosc
唯一明确记录为缺少公式返回失败代码的命令是
brew --prefix --installed c-blosc
它没有专门的输出,所以你可以做
if brew --prefix --installed c-blosc 2>/dev/null; then
echo "Installed"
else
echo "Nope"
fi
推荐阅读
- python - linux上的Python3 tkinter导入错误“导入tkinter ModuleNotFoundError:没有名为'tkinter'的模块”
- python - 考试成绩超过100分是什么意思?
- android - Android Kotlin 无法使用可见性在工具栏之间切换工具栏
- dll - 创建了一个在 UE4 中使用的 .dll 文件。我需要更改嵌入在他的 dll 文件中的设置
- python - 使用 python 监控 mysql 数据库的更新
- python - 带有 Lambda 条件的 Python Dataframe.apply()
- python - 终止无限循环
- django - 如何在 Django 网站中的模板中修复许多字段中的显示数据
- pagination - 使用带有页面参数的 GET 请求的分页 API 的适当响应代码是什么,其中参数不产生记录?
- javafx - 如何更新新的鼠标位置