What does the || : in this line of bash script from an rpm spec file do?

前端 未结 5 553
北荒
北荒 2021-01-19 04:02
ln -s /var/log/$SERVICE_NAME $RPM_INSTALL_PREFIX/logs || :

In the rpm spec file every line ends with || :

What is the

5条回答
  •  攒了一身酷
    2021-01-19 04:50

    I know others have answered, but I prefer to put:

    command || /bin/true

    IMHO that makes it a lot more obvious to the next person who is reading the bash script/spec file.

提交回复
热议问题