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

Re: setting up /etc/zshenv



On Apr 5, 10:34am, Timothy J. Luoma wrote:
} Subject: setting up /etc/zshenv
}
} I am trying to figure out if I have to "export" all variables set  
} on /etc/zshenv OR whether that will be done automatically OR whether  
} putting "ALL_EXPORT" at the top of /etc/zshenv will be enough.

`setopt allexport` causes all variables, including any the user sets
later, to be exported into the environment.  This is probably not what
you mean to have happen.

Variables that you want to put in the environment should be explicitly
exported.  Variables that you merely wish to have set in the local shell
should not.  In the absence of allexport, exporting is not automatic.

You could do

    setopt allexport

    # here, set all the vars you want exported ...

    unsetopt allexport

    # here, set all those to be in the shell only ...

but you probably don't want to leave allexport set at the end.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern



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