From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9723 invoked from network); 16 Sep 1998 16:23:06 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Sep 1998 16:23:06 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id MAA08398; Wed, 16 Sep 1998 12:08:46 -0400 (EDT) Resent-Date: Wed, 16 Sep 1998 12:04:59 -0400 (EDT) Message-ID: <19980916110804.A19057@emsphone.com> Date: Wed, 16 Sep 1998 11:08:04 -0500 From: Dan Nelson To: Ken Lareau Cc: zsh-users@math.gatech.edu Subject: /usr/bin/script annoyance References: <19980915151323.A5205@emsphone.com> <199809161309.JAA06097@mailhost2.squonk.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.2i In-Reply-To: <199809161309.JAA06097@mailhost2.squonk.net>; from "Ken Lareau" on Wed Sep 16 09:09:34 GMT 1998 X-OS: FreeBSD 2.2.7-STABLE Resent-Message-ID: <"yAYXL1.0.z02.h6-_r"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1817 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In the last episode (Sep 16), Ken Lareau said: > Thanks for the response; however, a more insidious problem has reared > it's head: both the above and my former method (modified to zsh, of > course) does not work, since the forking of a subshell doesn't reread > the startup scripts when 'script' is executed. > > I have been unsuccessful in figuring out why this seems to happen, as > the documentation I've read doesn't give a clue... anyone have any > ideas on how to get around this little problem? I've noticed this too. zsh-3.0.5 does not source _any_ startup scripts inside a 'script' run on the following OS's: FreeBSD 2.2, SCO 5.0.4, OSF/1 4.0, SunOS 4.1. It _does_ source startup scripts under Linux (RH 4.2). Oh weird. I just looked at the source to typescript under FreeBSD, and it reads in part: char *shell; shell = getenv("SHELL"); if (shell == NULL) shell = _PATH_BSHELL; execl(shell, "sh", "-i", NULL); So argv[0] is "sh", and it's entering /bin/sh compatibility mode. This is almost _exactly_ the problem Paul Lew reported to the zsh list on Aug 11 (mailinglist article archive/latest/4298). Both Bart Schaefer and zefram posted ugly workarounds :) I checked the whole FreeBSD source tree, and this is the only place that exec(zzz, "sh") was called where zzz was not "/bin/sh" or _PATH_BSHELL. I guess this does count as a /usr/bin/script bug, but every OS (besides Linux) exhibits the same weird behaviour, and it's sort of hard to change the SCO, OSF, and SunOs binaries. -Dan Nelson dnelson@emsphone.com