From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3856 invoked from network); 10 Aug 1998 01:15:28 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Aug 1998 01:15:28 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id UAA04031; Sun, 9 Aug 1998 20:57:32 -0400 (EDT) Resent-Date: Sun, 9 Aug 1998 20:57:22 -0400 (EDT) Message-ID: <19980809210204.33286@astaroth.nit.gwu.edu> Date: Sun, 9 Aug 1998 21:02:04 -0400 From: Sweth Chandramouli To: ZSH Users Subject: Re: Re: init files Mail-Followup-To: ZSH Users References: <19980809150805.47993@astaroth.nit.gwu.edu> <980809150442.ZM21544@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89 In-Reply-To: <980809150442.ZM21544@candle.brasslantern.com> Resent-Message-ID: <"s08-92.0.V-.nLapr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1715 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sun, Aug 09, 1998 at 03:04:41PM -0700, Bart Schaefer wrote: > On Aug 9, 3:08pm, Sweth Chandramouli wrote: > Yes, I did say that, but Greg Badros pointed > out that I should have said that INTERACTIVE was tested, not NO_RCS. > He included a pointer to a flow chart: > > http://www.cs.washington.edu/homes/gjb/ToolsTalks/unix-shell/img009.GIF hmm... i've actually still got both of those messages archived, and i don't find INTERACTIVE mentioned in either. [snip] > Where do you find that in the man page? My "man zshoptions" under > INTERACTIVE says, "The value of this option cannot be changed anywhere > other than the command line." > > } the tests given in the STARTUP FILES section of the manpage > } for a login shell (-l or -zsh) aren't true for any of my login > } shells > > How are you determining this? What does "echo $0" at a PS1 prompt show? that i need to read the manpages better. i totally misread the part about changing interactive (too many hours staring at a screen, i guess), and my shell is defined as a login one because its argv[0] is `-zsh'. i assumed it didn't because of the info in the faq on changing your shell, which mentioned linking it to -zsh; echo $0 shows that i am running -zsh, even though i never made that link. does login somehow invoke the shell and pass it a modified argv[0]? regardless, here is my revised list of tests for the sourcing of the various rc files. i'm not including the chart itself--it's at http://astaroth.nit.gwu.edu/~sweth/geek/zshinit.html if people want to see it; for those who don't, test one returns [no] if rc files are enabled, test two returns [no] if the shell isn't a login shell, and test three returns [no] if the shell isn't interactive. so, do these look right, or am i missing anything else? also, while figuring all of these out, a few things occurred to me. for one, does it make sense for the precedence of `unsetopt RCS' to be different from that of `setopt RCS' in test one? everywhere else, the inversions of options seem to have the same precedence as each other. secondly, is there any way to ensure that an action will be taken for all users upon logout? since test one is repeated just before sourcing $ZDOTDIR/.zlogout and /etc/zlogout, any user can just put `set NO_RCS' in his/her $ZDOTDIR/.zlogin, which is the last RC to be sourced, and avoid sourcing /etc/zlogout. finally, what is the purpose of the `+i' flag? `zsh +i' doesn't spawn a non-interactive shell (which would, i would imagine, immediately exit without some source of input), but instead spawns a shell where the only option set is SHIN_STDIN, but which is still interactive (and which ignores PROMPT, it seems). -- sweth. ----- `unsetopt OPTION' is equivalent to `setopt NO_OPTION' and `unsetopt NO_OPTION' is equivalent to `setopt OPTION' in terms of precedence. For example, zsh -f with `unsetopt NO_RCS' in /etc/zshenv will source /etc/zshenv, $ZDOTDIR/.zshenv, /etc/zshrc, and $ZDOTDIR/.zshrc. [1] DEFAULT--rc-enabled shell => [no] `setopt NO_RCS' called before test => [yes] `+f' flag present on shell invocation => [no] `-f' flag present on shell invocation => [yes] `setopt RCS' called before test => [no] [2] DEFAULT--non-login shell => [no] first character of argv[0] is `-' => [yes] `+l' flag present on shell invocation => [no] `-l' flag present on shell invocation => [yes] `setopt NO_LOGIN' called before test => [no] `setopt LOGIN' called before test => [yes] [3] DEFAULT--non-interactive shell => [no] stdin is a tty (isatty(0) is true) => [yes] `-c' flag present on shell invocation => [no] `-s' flag present on shell invocation => [yes] `+s' flag present on shell invocation => [no] `-i' flag present on shell invocation => [yes] `+i' flag present on shell invocation => [no] -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) *