ARGS should be accessible (and modifiable) from a script file
typically I would structure code like this so that one file contains the
library and one file contains the command line interface. then you can
directly run it, or use it from the REPL
./julia scriptrunner.jl arg1 arg2
include("scriptname.jl")
myfun(arg1, arg2)
On Sat, Jun 7, 2014 at 5:56 AM, Tomas Lycken <[email protected]> wrote:
> As a workaround, I usually wrap the script in a function, and execute it
> using
>
> julia -e 'include("myscript.jl"); myfunction("arg1", 2.0)'
>
> If you have a lot of arguments, that can become quite a hassle to type -
> so sometimes I wrap it in a bash script that just substitutes the arguments
> for me. It becomes a little messy with all the escapes and interpolation,
> but it's entirely possible:
>
> #!/bin/bash
> julia -e "include(\"myscript.jl\"); myfunction(\"$1\",
> \"interpolated-$2-from-bash.txt\")"
>
> and then call it like ./myscript.sh arg1 arg2
>
> Of course, if I do this I usually also do some argument checking already
> in bash, to avoid starting a Julia session and waiting for the included
> script to compile before it fails...
>
> // T
>
> On Friday, June 6, 2014 6:43:46 AM UTC+2, Francilio Araújo wrote:
>>
>> Thank guys.
>>
>