# \[SOLVED\] Choice of startup.jl files

**URL:** https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754
**Category:** New to Julia
**Created:** [December 2, 2019, 1:54pm UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754 "2019-12-02T13:54:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![RogerP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rogerp/32/17496_2.png) [@RogerP](https://discourse.julialang.org/u/RogerP)
#### Post date: [December 2, 2019, 1:54pm UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/1 "2019-12-02T13:54:54Z")

</div>

It would be nice if the command `julia --startup-file{yes|no}` could be modified to `julia --startup-file{filename.jl}`. I realise that I can do `julia -L <filename>` but that, surely, is for a different purpose.

There is a case for having a choice of `startup.jl` files IMHO. Is there a way of doing this? Thx.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [December 2, 2019, 3:05pm UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/2 "2019-12-02T15:05:35Z")

</div>

I think that you can set `DEPOT_PATH` now to a different directory (with 1.3). See

[https://github.com/JuliaLang/julia/pull/31682](https://github.com/JuliaLang/julia/pull/31682)

This still does not allow arbitrary _filenames_, but offers some customization.

---

<div class="post-metadata">

### Author: ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)
#### Post date: [December 2, 2019, 3:33pm UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/3 "2019-12-02T15:33:21Z")

</div>

As an alternative solution depending on what you want to do, you can run any arbitrary julia file before starting a REPL by just using Julia to execute the file as a script with the `-i` flag to start a REPL afterward.

```julia
❯ echo 'println("hello world")' > example.jl

~
❯ julia --startup-file=no -i example.jl 
hello world
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.2.0 (2019-08-20)
 _/ |\ __'_|_|_|\__'_| |  
|__/ |

julia> 

```

I think the startup file might be run earlier than the script, so this might not be a drop-in solution depending on what you’re doing.

---

<div class="post-metadata">

### Author: ![RogerP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rogerp/32/17496_2.png) [@RogerP](https://discourse.julialang.org/u/RogerP)
#### Post date: [December 3, 2019, 8:04am UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/4 "2019-12-03T08:04:32Z")

</div>

Many thanks both!  
@Tamas_Papp I didn’t know about DEPOT\_PATH – sounds like a good idea.  
@non-Jedi I’ll experiment with a semi-blank `start_up.jl` that does an `include()` depending on a choice.  
🙂

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [December 3, 2019, 8:45am UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/5 "2019-12-03T08:45:53Z")

</div>

Workarounds may help you in the short run, but I think that being able to specify a custom startup file path (with arbitrary filenames) is a reasonable feature request.

Please check if there is an existing issue and consider opening one.

---

<div class="post-metadata">

### Author: ![RogerP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rogerp/32/17496_2.png) [@RogerP](https://discourse.julialang.org/u/RogerP)
#### Post date: [December 4, 2019, 9:11am UTC](https://discourse.julialang.org/t/solved-choice-of-startup-jl-files/31754/6 "2019-12-04T09:11:27Z")

</div>

@Tamas_Papp It’s probably too trivial for a feature request. My `startup.jl` now just contains:

```julia
println(" Enter configuration file")
confFile = readline()
include(confFile)

```

which seems to do what I want.
