zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Christian Neukirchen <chneukirchen@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: root's path
Date: Sat, 17 Mar 2012 12:21:23 +0100	[thread overview]
Message-ID: <CAHYJk3Qoev7k6b6761SiVUWBD-EjnxmXQCzwJrGxfwoM8sp8ug@mail.gmail.com> (raw)
In-Reply-To: <87r4wr8opa.fsf@gmail.com>

On 17 March 2012 12:13, Christian Neukirchen <chneukirchen@gmail.com> wrote:
> "Benjamin R. Haskell" <zsh@benizi.com> writes:
>
>> On Sat, 17 Mar 2012, sergio wrote:
>>
>>> Hello.
>>>
>>> How zsh sets root's $path (and $PATH)?
>>> bash uses /etc/profile, for sudo completion there are /etc/zsh/zshrc
>>> and $PATH for non root is in /etc/zsh/zshenv. But I can't find root
>>> path anywhere.
>>
>> Zsh often ends up using /etc/profile or the equivalent.  On Gentoo,
>> for example, /etc/zsh/zprofile sources /etc/profile.env.  On OpenSUSE,
>> /etc/zprofile sources /etc/profile.
>
> Shouldn't $PATH be set in /etc/zshenv rather than zprofile?
> Else, it's impossible to override $PATH in ~/.zshenv.

Absolutely not, if you set PATH from *env, it makes it impossible to
inherit the PATH from the parent process' environment, even in
scripts, which will break a lot of things. The path should only be set
once on login of the current session, ie in zprofile if zsh is your
login shell, otherwise in the startup file for your login shell.

-- 
Mikael Magnusson


  reply	other threads:[~2012-03-17 11:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-17  1:45 sergio
2012-03-17  4:44 ` Benjamin R. Haskell
2012-03-17  8:58   ` sergio
     [not found] ` <alpine.LNX.2.01.1203170040230.18133__19065.733991056$1331959656$gmane$org@hp.internal>
2012-03-17 11:13   ` Christian Neukirchen
2012-03-17 11:21     ` Mikael Magnusson [this message]
2012-03-17 14:52       ` TJ Luoma
2012-03-17 14:54         ` Mikael Magnusson
2012-03-17 15:02           ` Mikael Magnusson
2012-03-17 15:33       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3Qoev7k6b6761SiVUWBD-EjnxmXQCzwJrGxfwoM8sp8ug@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=chneukirchen@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).