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

Re: environment settings



So, to sum up.

~user/.zshrc is the interactive shell customisation file of the user
~user/.zprofile is the login session customisation file of the user
~user/.zshenv can be used to set environment for every process
run by the corresponding user through zsh.

Most of the processes a user every runs are run during his login
session. Exceptions one can think of are:

- cron jobs: cron(8) generally doesn't run the user's shell but
  sh to parse the job command line, so .zshenv won't be sourced
  unless the cron job is a zsh script.
- ssh/rsh cmd. sshd/rshd does use the user's shell (which can be
  a pain), so .zshenv will be sourced if the user's login shell
  is zsh
- rexec, no shell involved.
- ~/public_html/xxx.cgi: no shell involved.
- ~/.forward: depends on the MTA, I don't think the user's shell
  is involved.

Basically, there's nothing for "a file that should set env
variable for every process run by this given user".

But in all the cases above, the user can explicitely call a "sh"
that sources a file that does the "exports".

-- 
Stéphane



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