# Run code non-interactively from script with -e option

**URL:** <https://discourse.julialang.org/t/run-code-non-interactively-from-script-with-e-option/71338>\
**Category:** General Usage\
**Created:** [November 11, 2021, 4:38pm UTC](https://discourse.julialang.org/t/run-code-non-interactively-from-script-with-e-option/71338 "2021-11-11T16:38:58Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [November 11, 2021, 4:38pm UTC](https://discourse.julialang.org/t/run-code-non-interactively-from-script-with-e-option/71338/1 "2021-11-11T16:38:58Z")

</div>

How do I escape correctly the quotation marks in

```julia
C:\Users\mzaffalon>julia -e 'println("hello world")'

```

on a Windows machine? The line above gives

```julia
ERROR: syntax: character literal contains multiple characters
Stacktrace:
 [1] top-level scope
   @ none:1

```

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [November 11, 2021, 4:45pm UTC](https://discourse.julialang.org/t/run-code-non-interactively-from-script-with-e-option/71338/2 "2021-11-11T16:45:03Z")

</div>

```julia
julia -e "println(\"hello world\")"

```

works for me.

---

<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:** [November 11, 2021, 8:13pm UTC](https://discourse.julialang.org/t/run-code-non-interactively-from-script-with-e-option/71338/3 "2021-11-11T20:13:17Z")

</div>

Related to this: I would like to start a GUI that uses [`Gtk.jl`](https://github.com/JuliaGraphics/Gtk.jl) by double clicking on a batch file; at the same time after the GUI starts, I would like to have the REPL open. I don’t want to put the script below in the startup file, so I call `julia gui.jl` at the command line where `gui.jl` contains

```julia
using Gtk
win = GtkWindow("GUI")
push!(win,GtkButton("Click Me"))
showall(win)

if !isinteractive()
    @async Gtk.gtk_main()
    Gtk.waitforsignal(win,:destroy)
end

```

as suggested in the manual [Non REPL Usage](https://juliagraphics.github.io/Gtk.jl/latest/manual/nonreplusage/#Non-REPL-Usage-1). However no interactive REPL is started.

If I remove the `if !isinteractive() ... end` statement, and I start the script using `julia -L gui.jl`, I get a responsive REPL together with the GUI.

Is there a better way of doing this or is the `-L` option meant for this purpose?
