# Variable interpolation in pkg command

**URL:** <https://discourse.julialang.org/t/variable-interpolation-in-pkg-command/39940>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [May 22, 2020, 7:41am UTC](https://discourse.julialang.org/t/variable-interpolation-in-pkg-command/39940 "2020-05-22T07:41:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [May 22, 2020, 7:41am UTC](https://discourse.julialang.org/t/variable-interpolation-in-pkg-command/39940/1 "2020-05-22T07:41:03Z")

</div>

Hi !  
Do you know if it is possible to use variable interpolation in pkg command to feed pkg with a list of packages ? (see example below)  
Thanks !

```julia
using Pkg

pkg"activate ."
pkg" instantiate"
pkg" status"

pck = ["Combinatorics", "DataFrames", "CSV"]
for p in pck
    cmd = " add $p"
    pkg"$cmd"
end

```

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [May 22, 2020, 8:03am UTC](https://discourse.julialang.org/t/variable-interpolation-in-pkg-command/39940/2 "2020-05-22T08:03:58Z")

</div>

Probably not since it’s a macro, but you have the standard function interface to pkg as well. `Pkg.add`

---

<div class="post-metadata">

**Author:** ![Fred](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fred/32/14175_2.png) [@Fred](https://discourse.julialang.org/u/Fred)\
**Post date:** [May 22, 2020, 8:09am UTC](https://discourse.julialang.org/t/variable-interpolation-in-pkg-command/39940/3 "2020-05-22T08:09:58Z")

</div>

@baggepinnen thank you !  
The working example is

```julia
using Pkg

pkg" activate ."
pkg" instantiate"
pkg" status"

pck = ["Combinatorics", "DataFrames", "CSV"]

for p in pck
    Pkg.add(p)
end

```
