bash - || 是什么意思: in this line of bash script from an rpm spec file do?

标签 bash rpm-spec

ln -s /var/log/$SERVICE_NAME $RPM_INSTALL_PREFIX/logs || :

在 rpm spec 文件中,每一行都以 || 结尾:

有什么意义|| : 为什么它在那里?

最佳答案

它会导致忽略任何错误,从而不会取消 rpm 操作。

如果上一个命令失败,

|| 会导致下一个命令运行,并且 : 总是成功。

关于bash - || 是什么意思: in this line of bash script from an rpm spec file do?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5737978/

相关文章:

linux - RPM build 没有那个文件或目录

linux - 在 info bash 中找不到 'date' 命令的描述 - 找到可从 shell 调用的所有命令的列表

bash 突破读取内部陷阱

linux - Bash 脚本在文件名中生成项目符号

php - 安装 src.rpm 是否运行 %install?

macros - 是否有任何语法或技巧可以创建多行 rpm 规范文件宏

bash - Linux pgrep 事件 xsession

linux - 如何使用 awk 删除输出文件中的 'www.'

linux - 构建 RPM 以安装包含 MimeType 的 .desktop 文件

macros - 为 RPM 宏提供一个带空格的参数