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

Re: environment settings



On 2008-06-17 21:32:29 +0100, Stephane Chazelas wrote:
> And while we're at it, it can also do an "unfunction echo" and
> "unalias echo" because someone might have redefined "echo" in
> the ~/.zshenv to behave POSIXly.

If the script uses zsh features of echo, yes. Now, in practice, if
a user writes a zsh script for himself, he knows what he has put in
his .zshenv, so that he should know what he needs to undefine in his
scripts (most often, there's nothing to do). Those who want to write
portable scripts shouldn't write zsh scripts anyway (BTW, even Debian
goes back from bash to POSIX sh). So, in short, there's no practical
problem.

> Let's be serious please. Or let's do as for csh, where one must
> add the -f to the shebang line to avoid this kind of problem.

Well, concerning csh, the -f is necessary just because users do nasty
things in their .cshrc (but csh is also at fault by not have something
like .cshenv where users can put *minimal* things). Anyway csh is
incompatible with everything else, has bugs and is no longer standard.
One should not write csh scripts any longer.

> ~/.zshenv can be a useful tool but it must be used with care. 

Yes, it must be used with care, but this is also true for other
config files.

Also, bash is really annoying by not sourcing some rc file:

brocoli:~> which tps
/home/vlefevre/bin/tps

(I install my own utilities, written by myself, in my home directory.)

brocoli:~> ssh -t doublejack tps
Connected to doublejack (from 140.77.14.28)
DISPLAY: localhost:11.0
bash: tps: command not found
Connection to doublejack closed.

Fortunately this has been fixed in Debian.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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