Bug 2851 - script(1) sets argv[0] of the started shell to "sh"
Summary: script(1) sets argv[0] of the started shell to "sh"
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-03-03 05:50 UTC by era
Modified: 1999-08-12 01:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description era 1997-03-03 05:50:02 UTC
	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)

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)
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$
Comment 1 mpp freebsd_committer freebsd_triage 1997-03-04 06:39:28 UTC
Responsible Changed
From-To: bin-bug-people->freebsd-bugs

Misfiled PR.   

This PR is a bit of an experiment.  I bouned it from the NetBSD-bugs 
mailing list to freebsd-gnats-submit, it it appears to have 
come through mostly intact. 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-12 00:57:59 UTC
State Changed
From-To: open->closed

Fixed in rev 1.10, MFC to rev 1.9.2.1 on RELENG_3.