exit

exit([code])

Quit (or control-D at the prompt). The default exit code is zero, indicating that the processes completed successfully.

Examples

In the Julia programming language, the function exit([code]) is used to terminate the current Julia session and exit the program. It can be called with an optional exit code as an argument. If no exit code is provided, the default code is zero, indicating successful program completion.

Exit the Julia session:

julia> exit()

This example terminates the current Julia session and exits the program.

Exit the Julia session with a specific code:

julia> exit(1)

This example exits the program with an exit code of 1.

Common mistake example:

julia> exit(-1)
ERROR: SystemExit: -1

In this example, a negative exit code is provided. The exit code should be a non-negative integer. Negative exit codes are not valid and may result in an error. Ensure that the exit code is a non-negative integer when using the exit function.

See Also

addprocs, atexit, cd, clipboard, EnvHash, exit, getpid, peakflops, ProcessExitedException, process_exited, process_running, procs, quit, readandwrite, redirect_stdout, rmprocs, run, setenv, spawn, withenv,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: