# How to write shell && and || in julia cmd syntax?

**URL:** <https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 24, 2023, 4:24pm UTC](https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148 "2023-02-24T16:24:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 24, 2023, 4:24pm UTC](https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148/1 "2023-02-24T16:24:09Z")

</div>

Hi there,  
I guess this is a standard question, but my google skills failed so far.

Can someone explain how to map shell’s && and || to julia’s own cmd syntax/api?  
thanks

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [February 24, 2023, 4:32pm UTC](https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148/2 "2023-02-24T16:32:15Z")

</div>

```julia
julia> success(`true`) && run(`echo wow`);
wow

julia> success(`false`) && run(`echo wow`);

julia> success(`false`) || run(`echo oh no`);
oh no

julia> success(`true`) || run(`echo oh no`);

julia>
```

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [February 24, 2023, 4:33pm UTC](https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148/3 "2023-02-24T16:33:56Z")

</div>

See also [Running External Programs · The Julia Language](https://docs.julialang.org/en/v1/manual/running-external-programs/#Pipelines)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [February 24, 2023, 4:40pm UTC](https://discourse.julialang.org/t/how-to-write-shell-and-in-julia-cmd-syntax/95148/4 "2023-02-24T16:40:08Z")

</div>

I don’t see anything about logical operators there.
