What does || : mean in the context of a shell script?
What does || :
mean in the context of a shell script?
I just came across this line:
eval "/usr/bin/mybinary aparameter" || :
Solution 1:
The ||
is an “or” comparison operator.
The :
is a null operator which does… Nothing. Well, it does return a successful exit status… If you need that?
So in your case:
eval "/usr/bin/mybinary aparameter" || :
The pseudo-example either eval
s as true or do… Nothing… But return a successful exit status. It seems silly but it’s all pseudo-code to show you general structure so it does seem to make sense in a way.