我已经通过sudo apt-get remove --purge node-stylus卸载了Debian上的手写笔包。
现在它说,当我尝试运行stylus命令:stylus: command not found。所以它可以正常工作。
但是在我的脚本中,我检查Stylus是否是通过以下方式安装的:
if ! command -v sudo stylus &> /dev/null; then
echo "ERROR: Stylus is not installed!"
exit 1
fi由于某些原因,command -v stylus仍然返回/usr/bin/stylus,因此脚本不会失败。
我检查了/usr/bin/,那里没有手写笔。
有人能给我解释一下为什么这样工作吗?
发布于 2022-02-07 16:51:05
Bash为查找维护一个缓存;您想要这样做
hash -r stylus强迫它忘记旧的价值。
当然,另外,当您真正想要command -v sudo时,不要使用command -v stylus,正如注释中已经指出的那样。
https://stackoverflow.com/questions/71021925
复制相似问题