1
votes

I'm new to programming in Julia and I'm currently making a grid search script that can cycle through different parameters for two other Julia scripts. I then want to save the output together with the input variables in a file, what I don't know however is how to run a script with predefined parameters within a script. The two scripts work when executed via the command line.

Thanks in advance.

1

1 Answers

1
votes

Ok, I'm not sure weather i understand the whole question, but...

Input parameters are stored in ARGS, you can change them, and hence run script with this parameters as input:

julia> ARGS
0-element Array{String,1}

julia> push!(ARGS, "Parameter 1")
1-element Array{String,1}:
"Parameter 1"

julia> include("test.jl")
p = "Parameter 1"

#where test.jl is:
for p in ARGS
   @show p
end

But don't do your program in such way, just construct a function, put them into the module and later use them in one script. See doc for more information about it.