# @\_\_DIR\_\_ doesn't work properly within backtick \`...\` notation

**URL:** <https://discourse.julialang.org/t/dir-doesnt-work-properly-within-backtick-notation/48566>\
**Category:** General Usage\
**Created:** [October 18, 2020, 12:18am UTC](https://discourse.julialang.org/t/dir-doesnt-work-properly-within-backtick-notation/48566 "2020-10-18T00:18:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Ainsworth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samuel_ainsworth/32/15644_2.png) [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Post date:** [October 18, 2020, 12:18am UTC](https://discourse.julialang.org/t/dir-doesnt-work-properly-within-backtick-notation/48566/1 "2020-10-18T00:18:14Z")

</div>

Consider the following script:

```julia
# this is correct:
println(@ __DIR__ )

# but this is not, it's just the cwd:
run(`echo $(@ __DIR__ )`)

# but this works:
foo = @ __DIR__
run(`echo $foo`)

```

I get

```julia
/home/samuela/dev/research/julia/odecontrol/difftaichi/electric
/home/samuela/dev/research/julia/odecontrol
/home/samuela/dev/research/julia/odecontrol/difftaichi/electric

```

which defies all logic to me.

Why does `@ __DIR__ ` have a different value when used in backtick notation?

---

<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:** [October 18, 2020, 12:35am UTC](https://discourse.julialang.org/t/dir-doesnt-work-properly-within-backtick-notation/48566/2 "2020-10-18T00:35:55Z")

</div>

This should be fixed by [https://github.com/JuliaLang/julia/pull/37007](https://github.com/JuliaLang/julia/pull/37007). Your example should work as expected on master.
