It returns a script return code of the last significant command to the calling init system. Whenever a command exits, the return code is stored on $? shell.
$? it really not necessary to explicitly specify $? but the scriptwriters probably just include him to be clear about what he intends to do.
exit: exit [n]
Exit from the shell.
Exiting a shell with a status of N. If N is omitted, the exit status is the command of the last command executed.
I also hope that you really do not mean eend $? of OpenRC :
eend retval [string]
If retval is not 0, then print the string using eerror and !! in square brackets at the end of the line. Otherwise, print ok in square brackets at the end of the line. The retval value is returned.
See the source .
source share