# REPL-like printing from a script?

**URL:** https://discourse.julialang.org/t/repl-like-printing-from-a-script/624
**Category:** General Usage
**Tags:** question
**Created:** [November 28, 2016, 8:15pm UTC](https://discourse.julialang.org/t/repl-like-printing-from-a-script/624 "2016-11-28T20:15:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)
#### Post date: [November 28, 2016, 8:15pm UTC](https://discourse.julialang.org/t/repl-like-printing-from-a-script/624/1 "2016-11-28T20:15:25Z")

</div>

I often develop scripts in Atom or in the REPL before running them on a compute cluster. The cluster is configured with a node for submitting scripts and several compute nodes. I can’t log in directly to a compute node, I can only log in to the submitting node.

What I would like to do is to submit a Julia script that behaves, with respect to echoing of the input lines and printing the results of evaluation of expressions that do not end in `;`, as if it were being run in the REPL.

Every time I want to do this I rediscover the `-i` option to `julia` then I rediscover that it doesn’t have the effect that I think it will.

Have I missed an obvious way of doing this?

---

<div class="post-metadata">

### Author: ![Lanfeng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lanfeng/32/76_2.png) [@Lanfeng](https://discourse.julialang.org/u/Lanfeng)
#### Post date: [November 30, 2016, 8:12pm UTC](https://discourse.julialang.org/t/repl-like-printing-from-a-script/624/2 "2016-11-30T20:12:40Z")

</div>

This is also a feature I am looking for. It brings a lot convenience when reading the output.  
However in Julia I always need to save the result to some other file.  
R users can do this by `R CMD BATCH -q test.R` command and obtain an `test.Rout` file with the following contents

```nohighlight
> x=rnorm(10)
> sum(x)
[1] 0.5408333
> summary(x)
    Min. 1st Qu. Median Mean 3rd Qu. Max. 
-2.13200 -0.06448 0.39510 0.05408 0.56820 1.09800 
> x^2
 [1] 0.549164326 0.136527004 0.197366650 0.973028278 0.177064401 0.008556946
 [7] 1.205633041 4.543555171 0.371503038 0.013645094
> 
> 
> 
> proc.time()
   user system elapsed 
  0.134 0.026 0.147 
test.Rout (END)

```
