Is there a way to run a (set of) Julia commands without entering the REPL?
E.g. julia.exe "using IJulia; notebook()"
doesn't work.
MY end goal is to be able to create a clickable batch file that allows me and others I share it with to open Jupyter without needing to worry about the command line or REPL.
You can use the -e
flag to the julia executable like this:
julia.exe -e "using IJulia; notebook()"
If you don't want the session to die after running, and you want it to give you a REPL afterwards, you can pass -i
as:
julia.exe -e "using IJulia; notebook()" -i
This option and others is documented in the "Getting started" section of the documentation
Or by running the executable with the -h
flag:
julia.exe -h
In addition with -e
option, julia
also read and evaluate stdin. Thus you can also do these using shell pipes/redirections:
$ echo '1+1' | julia
2
$ julia <<EOF
> 1+1
> EOF
2
$ julia <<< 1+1
2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With