From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9416 invoked from network); 25 Mar 1999 14:18:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Mar 1999 14:18:08 -0000 Received: (qmail 1632 invoked by alias); 25 Mar 1999 14:16:50 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2239 Received: (qmail 1622 invoked from network); 25 Mar 1999 14:16:47 -0000 Message-Id: <9903251400.AA54287@ibmth.df.unipi.it> To: zsh-users@sunsite.auc.dk Subject: Re: zsh startup files In-Reply-To: "Stefan Monnier"'s message of "25 Mar 1999 07:36:57 NFT." <5l1zidiw46.fsf@tequila.cs.yale.edu> Date: Thu, 25 Mar 1999 15:00:44 +0100 From: Peter Stephenson Stefan Monnier wrote: > >>>>> "Peter" == Peter Stephenson writes: > > This makes things rather complicated; there's no fundamental difficulty, > > but I'd prefer to keep it clean. The idea is not that you're at war with > > the sysadmin, who's supposed to make it easy for users to set their own > > preferences. But if this is popular enough... > > No. `No, this idea isn't popular', or `No, I am at war with the sysadmin who doesn't make it easy'? Various possibilities are - set GLOBAL_RCS_FIRST by default in the next version; but whenever we do something like that, something nasty happens. True, it shouldn't hurt the /etc/z* files which have to be able to run with no dot files in between, but it could have some effect for dot files (can anyone produce an example?) - make it available in the next version, and announce it may be set by default in future, so that you should add `unsetopt GLOBAL_RCS_FIRST' to /etc/zshenv if you really don't want it. > Actually, now that I think about it, why do we even need all those /etc/z* > files ? It seems that all except for either /etc/zprofile or /etc/zshenv > should be kept empty in all but really unusual circumstances (in which case > you can still use zshenv for the same purpose). Potentially, they may be useful, but I certainly agree they're overused and often abused. On this system here, we have /etc/zprofile, /etc/zshenv and /etc/zshrc --- and they're almost identical. > I guess I could live with just NO_GLOBAL_RCS that I would > set in my .zshenv although it won't do me any good as a sysadmin. (Do you mean GLOBAL_RCS_FIRST, or are you proposing a different option for not running global scripts apart from /etc/zshenv at all?) If it worked in .zshenv, it would certainly be made to work in /etc/zshenv: the question would be whether it should have an effect in .zshenv as well. > Now, how can I simulate NO_GLOBAL_RCS (I don't want to wait for my > sysadmins to install a newer zsh version) ? Again, if you mean, `how do I get all my code to run after the global scripts have finished', then I can't see any problem with the following, but I haven't tried it out, so I may have missed something. I've relied on the fact that .zshrc is run for any interactive shell (option interactive is set), and .zprofile and .zlogin for any login shell (option login set), and that a login shell is always interactive. That should answer your other question. 1. Move .zshenv, .zprofile, .zshrc, .zlogin to .real_zshenv, .real_zprofile, etc, etc. 2a. In .zshenv: if [[ ! -o interactive ]]; then [[ -f ~/.real_zshenv ]] && source ~/.real_zshenv fi 2b. Delete .zprofile 2c. In .zshrc: if [[ ! -o login ]]; then [[ -f ~/.real_zshrc ]] && source ~/.real_zshrc fi 2d. In .zlogin: [[ -f ~/.real_zshenv ]] && source ~/.real_zshenv [[ -f ~/.real_zprofile ]] && source ~/.real_zprofile [[ -f ~/.real_zshrc ]] && source ~/.real_zshrc [[ -f ~/.real_zlogin ]] && source ~/.real_zlogin -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy