什么是|| :在这行bash脚本从一个rpm spec文件吗? [英] What does the || : in this line of bash script from an rpm spec file do?

查看:118
本文介绍了什么是|| :在这行bash脚本从一个rpm spec文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

在RPM规范文件, ||每一行结束

什么是意义的 || :,为什么它有

What is the significance of the || : and why is it there?

推荐答案

这会导致忽略任何错误,这样的转速操作不会被取消。

It causes any error to be ignored so that the rpm operation isn't canceled.

|| 将导致下一个命令来运行,如果previous命令失败,而总是成功

|| causes the next command to run if the previous command failed, and : always succeeds.

这篇关于什么是|| :在这行bash脚本从一个rpm spec文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆