Thanks, I missed that thread. Although neither suggested solution works as I was hoping for.
I am trying to shoehorn julia into various parts of our pipeline and production systems. Having a single library that can function as an executable via shell is helpful. It's not a big deal, I just achieve this by % julia -L file.jl -e run_something() I do agree it's an awkward (and hopefully temporary) solution. Just wanted to see if I was missing something. Cameron On Thu, Mar 31, 2016 at 3:39 PM, James Fairbanks <jpfairba...@gmail.com> wrote: > This had been discussed in this thread > https://groups.google.com/d/msg/julia-users/ufpi8tV7sk8/-Uv0rtAWTWsJ > > > On Wednesday, March 30, 2016 at 2:37:44 PM UTC-4, Cameron McBride wrote: >> >> Simple question (I think): Is there an easy or idiomatic way to >> differentiate if a julia file is being run directly from when it's included? >> >> I'm looking for the equivalent of this in ruby: >> >> if $0 == __FILE__ >> puts "Running file" >> else >> puts "Included file" >> end >> >> Thanks. >> >> Cameron >> >