From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [128.61.1.1]) by werple.mira.net.au (8.6.10/8.6.9) with SMTP id BAA23751 for ; Thu, 25 May 1995 01:56:25 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA21594 (5.65c/Gatech-10.0-IDA for ); Wed, 24 May 1995 11:52:48 -0400 Received: by math (5.x/SMI-SVR4) id AA13079; Wed, 24 May 1995 11:50:28 -0400 Resent-Date: Wed, 24 May 1995 08:42:39 -0700 Old-Return-Path: From: schaefer@z-code.com (Barton E. Schaefer) Message-Id: <9505240842.ZM19150@zyrcon.z-code.com> Date: Wed, 24 May 1995 08:42:39 -0700 In-Reply-To: P.Stephenson@swansea.ac.uk "Re: [beta8] history saved on exec doesn't." (May 24, 2:51pm) References: <29967.9505241351@pyro.swan.ac.uk> Reply-To: schaefer@z-code.com X-Face: czU|*h"p8AX?4.I.yU.^s%TIMx|"-s,*'|#H^|e,QjE&!jL%<]:-.U/;khS%3a2BC5_d#)( mz=$$G0u9P&*N8cA~b[URf;lgKRif@#qEf[ltie#Gg0%6$b`e`k.Cgw:\qJx\\a7c(K7^3;gXW:e1@ J Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/29 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On May 24, 2:51pm, P.Stephenson@swansea.ac.uk wrote: } Subject: Re: [beta8] history saved on exec doesn't. } } > One other thing that is now broke is if I do any command substitution in } > the startup scripts (to set a variable say) after I have set the SAVEHIST } > and HISTFILE variables, and I don't have APPEND_HISTORY set, then this wipes } > out the history file as well. } } Actually, this is a good point and I don't think any of the clever } exec stuff should ever be done in a subshell (if forked is set in } execcmd()). This includes the SHLVL decrement since if you're } exec'ing a command in subshell you should presumably still `see' the } level of the parent shell I confess to have been pretty much ignoring zsh-list at the time this "clever exec stuff" was being put in, so please pardon any ignorance in the following questions, but: I presume "clever exec stuff" really does mean "clever stuff done at time of an `exec' zsh builtin" and *not* "clever stuff done whenever any call in the exec(2) family is about to be made". That is, I can't believe zsh is now saving history every time any non-builtin command is run. Please tell me I'm right. Then tell me, if I am right, why process substitution would have caused history to be saved in the first place. (I completely agree about never doing anything like this in subshells in general.) Next, explain "the SHLVL decrement" a bit; I have scripts that depend on knowing whether they were exec'd from a login shell or from a shell started via my .xsession, and they presently do it by examining SHLVL. If SHLVL is suddenly going to start reverting to 1 when a level-2 shell does an exec, my standard login routine is going to end up in an infinite loop. (As you can tell, I haven't installed any of these betas yet.) Finally, please tell me there's some way to shut off all this stuff and have an exec just be an exec. At least some way to shut off saving of history on exec; I don't know who thinks this is useful, but the last N things I typically do before any interactive shell would "exec" are either stuff from my .zlogin or commands I wouldn't want to repeat unless I were about to do *another* exec, and as such I'd rather the history were just left alone. Perhaps one of: alias exec='SAVEHIST=0 exec' alias exec='HISTFILE=/dev/null exec' (Or do we still have to use "exec HISTFILE=/dev/null"?) -- Bart Schaefer Vice President, Technology, Z-Code Software schaefer@z-code.com Division of Network Computing Devices, Inc. http://www.well.com/www/barts