# run(\`...\`),I want to return like the shell not process

**URL:** <https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [December 21, 2022, 8:07am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933 "2022-12-21T08:07:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangchunyong](https://avatars.discourse-cdn.com/v4/letter/z/d9b06d/32.png) [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Post date:** [December 21, 2022, 8:07am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933/1 "2022-12-21T08:07:17Z")

</div>

```julia
julia> run(`which samtools`)
/home/zhangchunyong/miniconda3/envs/chipseq/bin/samtools
Process(`which samtools`, ProcessExited(0))

julia> ans
Process(`which samtools`, ProcessExited(0))

```

But I want return “/home/zhangchunyong/miniconda3/envs/chipseq/bin/samtools”  
What should I do ?Thanks

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [December 21, 2022, 8:13am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933/2 "2022-12-21T08:13:27Z")

</div>

Use `Sys.which("samtools")`.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [December 21, 2022, 8:25am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933/3 "2022-12-21T08:25:49Z")

</div>

```julia
julia> read(`which samtools`, String)
"/usr/bin/samtools\n"

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [December 21, 2022, 8:27am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933/4 "2022-12-21T08:27:52Z")

</div>

Another variant to avoid the newline at the end:

```julia
readchomp(`which samtools`)

```
