Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: leading '=' in enviroment variable truncated

On Sun, 8 May 2016 10:59:49 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On May 7,  4:21pm, Jacob Lowe wrote:
> }
> } https://github.com/motdotla/dotenv/issues/140
> } 
> } TEST='=FOO' node -e 'console.log(process.env.TEST)'
> } 
> } This spits out "FOO" with no leading "=".
> As mentioned in the dotenv issue, this happens only on OSX.  I've just
> confirmed that it's a problem either with the library implementations
> of setenv() / unsetenv(), or with zsh's use of them.  If I comment out
> HAVE_SETENV / HAVE_UNSETENV from config.h and rebuild zsh, I am no
> longer able to reproduce the problem.

This appears to be a feature.


  These functions set, unset and fetch environment variables from the host
  environment list.  For compatibility with differing environment
  conven-tions, conventions, the given arguments name and value may be
  appended and prepended, respectively, with an equal sign ``=''.

Very useful, if I may say so.


Messages sorted by: Reverse Date, Date, Thread, Author