zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-users@sunsite.dk
Subject: Re: Broken /etc/zshrc ?
Date: Sun, 19 Aug 2001 21:12:46 +0200	[thread overview]
Message-ID: <20010819211246.A2466@ay.nerim.net> (raw)
In-Reply-To: <1010819180607.ZM17395@candle.brasslantern.com>

On Sun, Aug 19, 2001 at 18:06:06 +0000, Bart Schaefer wrote:
> I would think /etc/profile should be sourced in /etc/zprofile, if at all.

Thanks, I've sent a mail to SuSE support about that.

> /etc/zshenv is sourced by *every* zsh, even non-interactive scripts that
> are started with "zsh -f".  /etc/profile is intended to be sourced by
> login shells.  /etc/zshrc is sourced by login shells, but also by other
> interactive shells.  I'm not sure why so many linux distributors thought
> that /etc/profile needed to be read from /etc/zshrc, but it seems to be
> a common problem.

Yes, I have a 6.x RedHat at my lab and there is the same problem.

> } But /etc/profile sets the path (I think this is OK). Thus, if a
> } user sets his path in his .zshenv, then this path is lost because
> } /etc/zshrc is sourced after the user's .zshenv file.
> 
> This would still be true with /etc/zprofile, unfortunately.

So, is sourcing the /etc/profile a good idea? Shouldn't it be sourced
only if the shell is a login shell?

> You could put "source ~/.zshenv" in ~/.zshrc ...

I don't like that very much.

> or you could put "readonly path" in ~/.zshenv,

The path is modified, but there are other problems (e.g. ls colors).

> I suppose. Or in 4.0.x ~/.zshenv could start with
> 
>     setopt no_global_rcs

This is what I currently do.

>     [[ -o login && -r /etc/zprofile ]] && source /etc/zprofile
>     [[ -o interactive && -r /etc/zshrc ]] && source /etc/zshrc
>     [[ -o login && -r /etc/zlogin ]] && source /etc/zlogin

OK, if I need to read these files, I'll do this.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


  reply	other threads:[~2001-08-19 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-19 15:51 Vincent Lefevre
2001-08-19 16:55 ` Borsenkow Andrej
2001-08-19 18:06 ` Bart Schaefer
2001-08-19 19:12   ` Vincent Lefevre [this message]
2001-08-19 23:45     ` 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=20010819211246.A2466@ay.nerim.net \
    --to=vincent@vinc17.org \
    --cc=zsh-users@sunsite.dk \
    /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).