I think that needs some additional parens: `echo $(ENV["PATH"])`. This is
in fact, exactly what you need – Julia commands in backticks are not run by
a shell so there is no shell to expand any environment variables, only
Julia can expand them.

On Wed, Nov 2, 2016 at 7:02 AM, Simon Byrne <simonby...@gmail.com> wrote:

> Perhaps not quite what you had in mind, but
>
> `echo $ENV["PATH"]`
>
> should work
>
> On Wednesday, 2 November 2016 10:43:47 UTC, Christian Theil Have wrote:
>>
>> Hi,
>>
>> I've been trying to create a shell command that refers to an environment
>> variable, e.g.,
>>
>> echo $PATH
>>
>> Julia will interpolate $ in shell commands in backticks to Julia
>> variables, i.e., `echo $PATH`, will look for a Julia variable PATH.
>> What can I do if I really want to insist having a shell command that
>> includes a (non-quoted) dollar-sign? Currently,
>> my workaround is `sh -c "echo \$PATH"`, but this is not really
>> satisfactory.
>>
>> Best,
>> Christian
>>
>

Reply via email to