Setting environment variable in ZSH gives number expected -
i'm trying set array in zsh (configured using oh-my-zsh).
export ar=(localhost:1919 localhost:1918) but i'm getting error such:
zsh: number expected if don't add export command, it's fine. i'm not typing above in *rc file, in zsh prompt. problem?
you can't export array in zsh.
for more info: http://zsh.sourceforge.net/guide/zshguide02.html
note can't export arrays. if export parameter, assign array it, nothing appear in environment; can use external command
printenv varname' (again no$' because command needs know name, not value) check. there's more subtle problem arrays, too. export builtin special case of builtin typeset, defines variable without marking export environment. might think do
typeset array=(this doesn\'t work) but can't --- special array syntax understood when assignment not follow command, not in normal arguments case here, have put array assignment on next line. easy mistake make. more uses of typeset described in chapter 3; include creating local parameters in functions, , defining special attributes (of `export' attribute one) parameters.
Comments
Post a Comment