Search code examples
shelljuliainterpreter

Julia - run a script and keep the interpreter running


I am running a Julia script, but would like to have the interpreter keep itself open after the script is executed.

E.g. when I run julia example.jl, I'd like the script to run and the interpreter to stay open after that, so I can experiment with the results.

Is this possible?

Thanks!


Solution

  • Alternatively, you can just use the -i (interactive) flag. See julia --help for more details.

    julia -i example.jl
    

    Note, though, that the REPL won't start if the script errors.