How to exit Julia altogether from bash terminal?

Hello,
I am launching a julia script with a bash script. How can I terminate the julia script so to go back into bash?
I used exit(0) but the terminal remains in Julia…
Thanks

Can you please elaborate with a concrete minimal working example what you mean?

1 Like

It sounds like you’re hoping that Julia will exit() but also that the terminal hosting it in your OS will close. I don’t know if Julia can signal that behavior, but depending on your OS there are ways to spawn terminal processes (like julia) that will automatically close upon completion.

If I start julia in bash with

julia -- hallo.jl

where ‘hallo.jl’ has

println("hallo")

I get the bash prompt after the “hallo”. This is because the EOF of the script terminates julia, an explicit exit() is not needed.

a file ‘test.jl’ having

You can launch julia as exec julia … which will replace the bash process by the Julia one, so when returning from Julia it will close the terminal window

7 Likes

perfect, thank you!