# @\_\_DIR\_\_ different inside command (\`...\`)

**URL:** <https://discourse.julialang.org/t/dir-different-inside-command/16200>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [October 11, 2018, 6:46pm UTC](https://discourse.julialang.org/t/dir-different-inside-command/16200 "2018-10-11T18:46:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 11, 2018, 6:46pm UTC](https://discourse.julialang.org/t/dir-different-inside-command/16200/1 "2018-10-11T18:46:43Z")

</div>

This MWE demonstrates it:

```julia
code = raw"""
@show cmd = `echo $(@ __DIR__ )`
@show thisdir = @ __DIR__
@show cmd2 = `echo $(thisdir)`
"""
file = tempname() * ".jl"
write(file, code)
cd(expanduser("~"))
include(file)

```

as it prints

```julia
cmd = #= /tmp/julia4jHJh2.jl:1 =# @cmd("echo \$(@ __DIR__ )") = `echo /home/tamas/`
thisdir = #= /tmp/julia4jHJh2.jl:2 =# @ __DIR__ () = "/tmp"
cmd2 = #= /tmp/julia4jHJh2.jl:3 =# @cmd("echo \$(thisdir)") = `echo /tmp`
`echo /tmp`

```

Is this a bug? v"1.1.0-DEV.439".

@yakir12
