Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh handling of non-standard if-evaluations
- X-seq: zsh-users 11159
- From: Daniel Qarras <dqarras@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: zsh handling of non-standard if-evaluations
- Date: Tue, 30 Jan 2007 10:30:18 -0800 (PST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=V0mqMBVDbiMpgD5BYLeNB8jI51Nme8cjApL5NNwBAK2epvA7cT9+oMGPOjcAIkNturnGM99ywOL3rFRtEWijePAY8a7wrAb7peSrIq3gNg9esgti6LCsrxu8oUayH/lLBCkGoebu5Ub3Tngso7LBGWxlOUqQTQdQq/3qyK1BHHk=;
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi!
> > } Hmm, my login shell is zsh and I've set in my ~/.zshenv:
> > }
> > } . /etc/profile
> > }
> > } which in turns goes thru /etc/profile.d/*.sh and one of those
> > scripts
> > } is from the proprietary application. So perhaps I should do
> "setopt
> > } no_equals" before the above mentioned line?
> >
> > Generally speaking ~/.zshenv is too early in the startup script
> order
> > to be reading /etc/profile from there. If you need to read
> > /etc/profile you should do it from ~/.zprofile.
>
> Good point. I definitely need to do it, I have an account on several
> machines where admins and applications add scripts under
> /etc/profile.d
> to set up various things like paths and variables.
>
> > your original state, you need something like this:
> >
> > zmodload -i zsh/parameter && {
> > __zsh=( ${(kv)options} )
> > emulate sh
> > . /etc/profile
> > emulate zsh
> > options=( $__zsh )
> > unset __zsh
> > }
> >
> > This has the side-effect of vacating any option settings from any
> > scripts
> > in /etc/profile.d that happen to know about zsh, but I think of
> that
> > as a good thing.
>
> I need to test this a bit. I'll get back to this when I've done some
> experiments.
Uh, oh..
I am testing this under RHEL4 / FC6, both have zsh RPMs that comes with
/etc/zprofile which has the following lines:
# source profile
if [ -f /etc/profile ]; then
source /etc/profile
fi
And this is also failing. I made a bug for RH about this at:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225454
But.. reading more about this it seems that placing settings etc in zsh
startup scripts seems to be a source for endless debate.
For example, admin sets locales in /etc/profile but I want use locale
settings I set up in my init files in any case. .zshenv would be
logical, I guess, but it's too early as /etc/profile gets sources
later. .zprofile won't work because it's not sources when starting an
xterm. And .zshrc is no good because it's not sourced when session is
not interactive!
D'oh!
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
Messages sorted by:
Reverse Date,
Date,
Thread,
Author