Meaning of colon in Bash after a double pipe

I am trying to understand this piece of code:

. || { : ; echo "Error while loading the specified file" >&2; exit 2; }

I get that the code in the bracket is called when the specified file isn't available. But what does this : ; mean? Moreover, when you delete it, then the script doesn't work.


The colon is null statement, so it does nothing. The semi-colon ends a list of commands.

Not sure why anyone would write the above, it's basically "do nothing, then do the echo" which seems like it could be simplified. Could be somebody's copy-paste baggage.

Need Your Help

Reference Object Property with JSON.Net when property has special characters

c# xml json

I am using JSON.Net to update an object within an XML File. This works great! However, I need to update a property that has some special charecters in it and I can't find any information out there ...

HQL syntax problem

sql hibernate hql

I have a problem with the following HQL query: