# How to launch multiple Julia runs one after another?

**URL:** <https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 17, 2022, 11:03am UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351 "2022-07-17T11:03:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [July 17, 2022, 11:03am UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351/1 "2022-07-17T11:03:14Z")

</div>

I have 25 \*.jl files that need to be run one after another. Each of them could take an extended amount of time.

Is there a way I can create a master\_run.jl file and tell Julia to run these 25 jl files one after another. Something like the below?

```julia
run A01.jl
run A02.jl
...
run A25.jl

```

Thanks.

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [July 17, 2022, 11:49am UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351/2 "2022-07-17T11:49:25Z")

</div>

Put in your `master_run.jl` file the following

```julia
run(`julia A01.jl`)
run(`julia A02.jl`)
...
run(`julia A25.jl`)

```

See [Running External Programs · The Julia Language](https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs) and [Getting Started · The Julia Language](https://docs.julialang.org/en/v1/manual/getting-started/).

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [July 17, 2022, 12:02pm UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351/3 "2022-07-17T12:02:03Z")

</div>

Many thanks!

Unfortunately, I got the below error:  
`ERROR: LoadError: IOError: could not spawn `A01.jl`: no such file or directory (ENOENT)`

The master\_run.jl file and the rest of the jl files are in the same directory.

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [July 17, 2022, 12:16pm UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351/4 "2022-07-17T12:16:29Z")

</div>

This is what I do:

```julia
mzaffalon@NBFAE01-6CS3PF2 MINGW64 ~/test
$ ls
A01.jl A02.jl master_run.jl 

mzaffalon@NBFAE01-6CS3PF2 MINGW64 ~/test
$ cat master_run.jl
run(`julia A01.jl`)
run(`julia A02.jl`)

mzaffalon@NBFAE01-6CS3PF2 MINGW64 ~/test
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.8.0-rc1 (2022-05-27)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> include("master_run.jl")
A01: hello world
A02: hello world
Process(`julia A02.jl`, ProcessExited(0))

julia>

```

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [July 17, 2022, 12:36pm UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351/6 "2022-07-17T12:36:33Z")

</div>

Many thanks! It is working now.

I turns out I missed the ‘julia’ part inside the parentheses.
