November 2017
Beginner
316 pages
6h 40m
English
We have already learned how to start the Julia REPL and evaluate basic statements in it.
There are various options provided by Julia for running the program. We can directly run statements without even opening the REPL:
$ julia -e 'println("Hello World")'Hello World
We can even run a loop without starting the REPL:
$ julia -e 'for i=1:5; println("Hello World"); end'Hello WorldHello World…
It is also possible to pass arguments:
$ julia -e 'for i in ARGS; println(i); end' k2so r2d2 c3po r4 bb8k2sor2d2c3por4bb8
ARGS is used to take command-line arguments to the script.
We can find the different options that Julia supports using the --help option:
$ julia --helpjulia [switches] -- [programfile] [args...]-v, --version ...
Read now
Unlock full access