Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh handling of non-standard if-evaluations
- X-seq: zsh-users 11150
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Daniel Qarras <dqarras@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: zsh handling of non-standard if-evaluations
- Date: Sun, 28 Jan 2007 12:05:33 -0800
- In-reply-to: <184104.7951.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <184104.7951.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Jan 28, 11:00am, Daniel Qarras wrote:
}
} 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.
As I said before, reading /etc/profile should be done with "emulate sh"
in effect. Unfortunately "emulate zsh" doesn't fully reverse the effect
of "emulate sh", because emulation turns off options that differ from
the defaults no matter which shell is being emulated. So to get back to
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author