Reputation: 1457
From within a julia session, how can I get the path of the julia binary that is being used by that session?
Upvotes: 4
Views: 357
Reputation: 20248
The complete command that was used to run julia is given by Base.julia_cmd
. If you want to spawn a new process, you should perhaps keep this whole command (including the system image):
julia> Base.julia_cmd()
`/home/francois/.local/julia-1.4.1/bin/julia -Cnative -J/home/francois/.local/julia-1.4.1/lib/julia/sys.so -g1`
If you only want the path to the julia binary, it is the first component of the command:
julia> Base.julia_cmd()[1]
"/home/francois/.local/julia-1.4.1/bin/julia"
Upvotes: 1