When I run MegaGlest with just --version and it does not seem to run into an error condition, I'd expect its exit code to be 0. However, the exit code is 255:
tomreyn@atibox:~/SCM/megaglest-trunk$ mk/linux/megaglest --ini-path=mk/linux/ --data-path=mk/linux/ --version; echo $?
megaglest v3.6.1-dev
Compiled using: GNUC: 40603 [64bit] on: Jul 15 2012 18:47:45
SVN: [Rev: 3455M] - using STREFLOP [SSE] - [no-denormals]
255
If a segmentation fault occurs it seems to return exit code 254 instead.
The start_megaglest wrapper script did not return any error codes whatsoever so far. This issue is fixed in 3456, but the misleading exit codes the binary produces need yet to be looked into.