# How to make Julia exit 1 on error when run at the end of a pipe?

**URL:** <https://discourse.julialang.org/t/how-to-make-julia-exit-1-on-error-when-run-at-the-end-of-a-pipe/90879>\
**Category:** General Usage\
**Created:** [November 27, 2022, 3:10am UTC](https://discourse.julialang.org/t/how-to-make-julia-exit-1-on-error-when-run-at-the-end-of-a-pipe/90879 "2022-11-27T03:10:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Post date:** [November 27, 2022, 3:10am UTC](https://discourse.julialang.org/t/how-to-make-julia-exit-1-on-error-when-run-at-the-end-of-a-pipe/90879/1 "2022-11-27T03:10:22Z")

</div>

When I run this at the command line, the exit code seems to be 0:

```julia
% echo 'error()' | julia && echo pass 
ERROR: 
Stacktrace:
 [1] error()
   @ Base ./error.jl:44
 [2] top-level scope
   @ none:1
pass
%

```

In contrast, grep does just fine

```julia
% echo 'error()' | grep f && echo pass
%

```
