From mpp  Sun Mar  2 22:06:42 1997
Received: (from mpp@localhost)
          by freefall.freebsd.org (8.8.5/8.8.5) id WAA02512
          for freebsd-gnats-submit; Sun, 2 Mar 1997 22:06:42 -0800 (PST)
Received: from mail.NetBSD.ORG (homeworld.cygnus.com [205.180.83.70])
          by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id OAA07281
          for <mpp@freefall.freebsd.org>; Sun, 2 Mar 1997 14:40:38 -0800 (PST)
Received: (qmail-queue invoked by uid 605); 2 Mar 1997 22:35:15 -0000
Received: (qmail-queue invoked by uid 506); 2 Mar 1997 22:35:02 -0000
Received: (qmail-queue invoked from smtpd); 2 Mar 1997 22:20:22 -0000
Received: from ttu5.in.helsinki.fi (HELO hello.netbsd.fi) (128.214.182.133)
  by homeworld.cygnus.com with SMTP; 2 Mar 1997 22:20:19 -0000
Received: (from era@localhost) by hello.netbsd.fi (8.7.5/8.7.3) id VAA20717; Sun, 2 Mar 1997 21:34:41 +0200 (EET)
Message-Id: <199703021934.VAA20717@hello.netbsd.fi>
Date: Sun, 2 Mar 1997 21:34:41 +0200 (EET)
From: era@iki.fi
Sender: mpp
Reply-To: era@iki.fi
To: gnats-bugs@gnats.netbsd.org
Subject: bin/3276: script(1) makes bash emulate POSIX /bin/sh
X-Send-Pr-Version: 3.95

>Number:         2852
>Category:       bin
>Synopsis:       script(1) sets argv[0] of the started shell to "sh"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mpp
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar  2 22:10:01 PST 1997
>Closed-Date:    Mon Mar 3 22:38:41 PST 1997
>Last-Modified:  Mon Mar  3 22:39:17 PST 1997
>Originator:     System Era
>Release:        1.2
>Organization:
People Who Are Not Old Enough for Unix (Honorary Member Emeritus)
>Environment:
bash-1.14.7(1) right out of the box;
	1.2 #1 distribution pretty much without anything changed
	(I've barely installed Emacs, Bash, Ssh, some Emacs libraries 
	... and (gasp) GNU Smalltalk)

 $ what /usr/bin/script
 /usr/bin/script
	  Copyright (c) 1980, 1992, 1993

	
System: NetBSD hello.netbsd.fi 1.2 NetBSD 1.2 (GENERIC) #1: Wed Sep 11 00:43:55 CDT 1996 scottr@spot:/usr/src/sys/arch/mac68k/compile/GENERIC mac68k


>Description:
	script(1) starts my $SHELL allright but it sets argv[0] to "sh"
	which Bash interprets as a request to emulate the POSIX shell 
	as closely as possible. 
	  That means, among other things, that none of my aliases and
	other neat stuff I normally use under Bash are not available.
	  Ideally, script(1) should not look like you're starting a
	new session, but rather let a naive user believe you're still
	executing the same shell as before you started script(1)
	

>How-To-Repeat:
	neat bash prompt (time, date, hostname, bells, whistles) hello$ script
	Script started, output file is typescript
	bash$ # oops, this looks like /bin/sh more than Bash :-(
	bash$ echo $0
	sh
	bash$ exit
	Script done, output file is typescript
	neat bash prompt (time, date, hostname, bells, whistles) hello$

>Fix:
	No particular need for script(1) to set argv[0] to anything in 
	particular, is there? 
	  Just do execv (shellname, shellname, options, (char *) NULL)
	instead of execv (shellname, "sh", options, (char *) NULL)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mpp 
State-Changed-When: Mon Mar 3 22:38:41 PST 1997 
State-Changed-Why:  
Dup of PR# 2851. 


Responsible-Changed-From-To: bin-bug-people->mpp 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Mon Mar 3 22:38:41 PST 1997 
Responsible-Changed-Why:  
Dup PR. 
>Unformatted:

