Running Julia .jl files

Solution 1:

If you want to run the julia script from a command line then just do

/path/to/julia script-name.jl

In the shell of your choice.

If you want to run it from the julia repl then you want something like so:

julia> include("path/to/script-name.jl")

As to why your output is split like that I think we would need to see your code.

Solution 2:

You can chmod your script and put the path to the julia binary at the to line.

Consider the following simple script hello.jl

#!/usr/bin/julia
println("Hello world")

change permission on the script using

chmod a+x hello.jl

Run the script using ./hello.jl

Solution 3:

Look into using IJulia w/in Jupyter Notebook: https://github.com/JuliaLang/IJulia.jl

Solution 4:

step 1: Open terminal

step 2: go to your Julia file location

step 3: execute the julia file

/path/to/folder script-julia.jl

Hit the up arrow, if it helps you. Thank you.