Startup options and Julia scripts

Without any options, the julia command starts up the REPL environment. A useful option to check your environment is julia -v. This shows Julia's version, for example, julia version 1.0.0. (The versioninfo()function in REPL is more detailed, and the VERSION constant only gives you the version number: v"1.0.0"). An option that lets you evaluate expressions on the command line itself is -e, for example:

julia -e 'a = 6 * 7;println(a)' 

The preceding commands print out 42 (this also works in a PowerShell window on Windows, but in an ordinary Windows Command Prompt, use " instead of the ' character).

Some other options that are useful for parallel processing will be discussed in Chapter 9, Running External Programs ...

Get Julia 1.0 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.