I'm studying System V init scripts found in /etc/init.d/ in current Debian 7.4.0 wheezy release(But its also present in other, previous, releases). Almost all of them (from existing services) found in that folder end with, basically an empty line containing nothing but a colon (:) sign. Even the 'skeleton' template file that can be found there for the purpose of writing your own init scripts has this. Here is a copy/paste from the end of the code:
esac
:
(that was the end of an case statement and then there is the end of the file)
What is also interesting is that there is no exit 0 or exit $? call, except only in some conditions in the case statement, that would be called otherwise so it seems as if that colon sign is a sort of a replacement for it? Full skeleton file code is here: https://gist.github.com/ivankovacevic/9917139
What could that colon be and why?
:
is a builtin which evaluates totrue
in bash, so I suspect this is to reset$?
to 0. – Goodwin