Invoking Julia from the Terminal on MacOS

question

#1

hi
happy to found julia after long time of hesitations in the choice of a language to make animated graphicals mathematics
now, i follow the instructions on
http://docs.julialang.org/en/stable/manual/getting-started/
i type “julia” in a temrinal windows of my mac os X.10.4
in the julia session i type : julia essai.jl
answer :
ERROR: UndefVarError: julia not defined
i guess that something is wrong with the fact that i installed julia throught a dmg file while the use of julia in the termonal shoul have maybe needed a mor "deep "installation with the sources etc ?
if anyone can help for this ultra-beggining question…
thanks !


#2

To invoke Julia in the Terminal, you need to make sure that the julia command-line program is in your PATH. On MacOS, I usually do this by creating a link in /usr/local/bin:

sudo ln -s /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

(Assuming you have installed “Julia-0.5” into your Applications folder, as is typical.)


#3

Also, the command in that doc is shell command used to run the script,not how you run a script once you’re in the julia REPL. To run a script in the REPL use include("script_path.jl")


#4

ok thank you both of you
both work now :
julia essai.jl from the terminal
include(“essai.jl”) from the julia prompt
i prefer the first method
now i can start
thanks