O'Reilly logo

Mastering Julia by Malcolm Sherrington

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing commands

We saw in the first chapter that it is possible to shell out of the console REPL to the operating system by using the ; command. In addition, Julia provides a number of built-in functions so that scripts can interactive with the OS and its filesystem. Most of these commands mirror the standard Unix commands. For Windows users, they will be familiar to those who have used the MINGW or similar shells.

Two familiar ones are pwd() and cd():

julia> pwd();
"/Users/malcolm/Packt/Chapter-4"
julia> cd("../../Work");
julia> pwd();
"/Users/malcolm/Work"

The pwd() command indicates where we are now (print working folder), and of course, cd() is used to change the folder. This can be relative to the current location or an absolute if the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required