# How to use \* with backticks

**URL:** https://discourse.julialang.org/t/how-to-use-with-backticks/11682
**Category:** New to Julia
**Created:** [June 14, 2018, 8:09pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682 "2018-06-14T20:09:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ko56](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ko56/32/2684_2.png) [@ko56](https://discourse.julialang.org/u/ko56)
#### Post date: [June 14, 2018, 8:09pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/1 "2018-06-14T20:09:47Z")

</div>

I cannot figure out how to run the shell command “ls data/\*.sol” using Julia’s backtick mechanism. The obvious

run(`ls data/*.sol`)

produces

ls: data/\*: No such file or directory  
ERROR: failed process: Process(`ls 'data/*'`, ProcessExited(1)) [1]

---

<div class="post-metadata">

### Author: ![ko56](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ko56/32/2684_2.png) [@ko56](https://discourse.julialang.org/u/ko56)
#### Post date: [June 14, 2018, 8:11pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/2 "2018-06-14T20:11:07Z")

</div>

Sorry, somehow the backticks didn’t make it into

`run(`ls data/\*.sol`)`

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [June 14, 2018, 8:18pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/3 "2018-06-14T20:18:44Z")

</div>

`run` doesn’t run a shell unless you explicitly ask it to. Try

```julia
run(`sh -c ls data/*.sol`)

```

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [June 14, 2018, 8:22pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/4 "2018-06-14T20:22:32Z")

</div>

It’s really not recommended to use `run(`sh -c ....`)` because it opens you up to all of the quoting problems, security holes, and general confusion of shell interpolation. See: [A small package to run string as shell command - #5 by stevengj](https://discourse.julialang.org/t/a-small-package-to-run-string-as-shell-command/6163/5) and [Quoting in shell commands](https://discourse.julialang.org/t/quoting-in-shell-commands/6781)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [June 14, 2018, 8:24pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/5 "2018-06-14T20:24:05Z")

</div>

You can do file globbing without the shell using

> **[GitHub - vtjnash/Glob.jl: Posix-compliant file name pattern matching](https://github.com/vtjnash/Glob.jl)**
>
> Posix-compliant file name pattern matching. Contribute to vtjnash/Glob.jl development by creating an account on GitHub.

and interpolate the resulting list of files into a backtick expression.

---

<div class="post-metadata">

### Author: ![ko56](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ko56/32/2684_2.png) [@ko56](https://discourse.julialang.org/u/ko56)
#### Post date: [June 14, 2018, 8:38pm UTC](https://discourse.julialang.org/t/how-to-use-with-backticks/11682/6 "2018-06-14T20:38:01Z")

</div>

Thanks, that’s what I was looking for.

Perhaps the section “Running External Programs” of the manual could mention the (shell) globbing issue?
