exit_program
exit_program — terminates the interpreter.
exit_program (return_value)
return_valueAn integer value to be returned to the operating system when the program exits.
This function does not return.
Terminate the interpreter immediately and return the provided integer value to the operating system as an exit code.
Running this program...
#!/usr/cogent/bin/gamma
//Program: exiting.g
atexit(#princ("Exiting now.\n"));
princ("Started running...\n");
princ("Still running.\n");
exit_program(7);
princ("You missed this part.\n");
...gives these results:
[]$ gamma exiting.g Started running... Still running. Exiting now. []$
Exit showing abnormal termination of -1 (255) to the operating system. exit_program(-1); />echo $? 255 />