From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12041 invoked from network); 15 Jun 1998 14:34:13 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Jun 1998 14:34:13 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id KAA12410; Mon, 15 Jun 1998 10:28:59 -0400 (EDT) Resent-Date: Mon, 15 Jun 1998 10:28:59 -0400 (EDT) From: Zefram Message-Id: <199806151428.PAA10680@taos.demon.co.uk> Subject: Re: Wrong emulation mode if exec'd by su To: aumuelle@mi.uni-erlangen.de Date: Mon, 15 Jun 1998 15:28:07 +0100 (BST) Cc: zsh-workers@math.gatech.edu, aumuelle@mi.mi.uni-erlangen.de In-Reply-To: <199806151358.PAA13243@helena.mi.uni-erlangen.de> from "Martin Aumueller" at Jun 15, 98 03:58:41 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"omYkY2.0.r13.g-IXr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4121 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Martin Aumueller wrote: >I have a problem with zsh-3.1.4: If I su - to an account the zsh sees >"su" as executable name -- starting with 's' -- and thus switches to >Bourne shell emulation mode, not the behaviour desired by me. I have >solved this problem by testing the full executable names against "sh", >"csh" and "ksh" with strcmp and now it works as I expect it. The original behaviour is correct. "su" really should not give the shell this weird argv[0] (some versions don't). But on the older systems where it does, it's more likely that the shell being invoked is supposed to be sh, so treating a name of "su" as "sh" is the best behaviour. To get round this problem, if you can't fix su, put an "exec zsh -l" in your .profile. Optionally change your login shell to /bin/sh. >However, in the patch below I didn't take into account the case >starting with 'b', don't know what that should be, "bsh" == Bourne shell. -zefram