<p>I would like to execute an OS command from my ruby script but I want to add an argument from a ruby variable.</p>

<p>I know that's possible by using keyword <em>system</em> like that :</p>

<pre><code>#!/usr/bin/env ruby
directory = '/home/paulgreg/'
system 'ls ' + directory
</code></pre>

<p>but is that possible by using the "backquotes or backticks syntax" ?
(I mean by using that syntax : <code>ls</code>)</p>

No, that will just concatenate the output from
```
ls
```
and the contents of
```
directory
```
.
But you can do this:
```
```
#!/usr/bin/env ruby
directory = '/home/paulgreg/'
`ls #{directory}`
```
```