# linux legato-spm -environment variable $(LEGATO\_ROOT) fails

**URL:** <https://forum.sierrawireless.com/t/linux-legato-spm-environment-variable-legato-root-fails/12123>\
**Category:** Uncategorized\
**Created:** [March 14, 2016, 8:34pm UTC](https://forum.sierrawireless.com/t/linux-legato-spm-environment-variable-legato-root-fails/12123 "2016-03-14T20:34:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnofleek](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/johnofleek/32/4726_2.png) [@johnofleek](https://forum.sierrawireless.com/u/johnofleek)\
**Post date:** [March 14, 2016, 8:34pm UTC](https://forum.sierrawireless.com/t/linux-legato-spm-environment-variable-legato-root-fails/12123/1 "2016-03-14T20:34:08Z")

</div>

using the latest legato-spm 16-01  
and

```auto
source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv 
```

// command line build apps

`
mkapp -v -t wp85 -i $LEGATO_ROOT/interfaces/airVantage assetDataTutorial.adef `  
works

But

```auto
mkapp -v -t wp85 -i $(LEGATO_ROOT)/interfaces/airVantage assetDataTutorial.adef

// fails like this
WARNING:root:could not open file '/etc/apt/sources.list.d/devstudio.list'
LEGATO_ROOT: command not found
...
```

Any ideas?

---

<div class="post-metadata">

**Author:** ![daav](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/daav/32/2767_2.png) [@daav](https://forum.sierrawireless.com/u/daav)\
**Post date:** [March 15, 2016, 6:19am UTC](https://forum.sierrawireless.com/t/linux-legato-spm-environment-variable-legato-root-fails/12123/2 "2016-03-15T06:19:41Z")

</div>

Hi John,

In Linux bash shell (and a couple of others actually), variables can be referenced either with `
$NAME
` or `
${NAME}
`

The following syntax: `
$(command)
` actually calls the command and print the stdout.  
e.g. `$ export foo=$(echo bar)
$ echo $foo
bar`

This explains the `
LEGATO_ROOT: command not found
`
