Subject: bin/3276: script(1) makes bash emulate POSIX /bin/sh
To: None <email@example.com>
From: None <firstname.lastname@example.org>
Date: 03/02/1997 21:34:41
>Synopsis: script(1) sets argv of the started shell to "sh"
>Responsible: bin-bug-people (Utility Bug People)
>Arrival-Date: Sun Mar 2 14:35:01 1997
>Originator: System Era
People Who Are Not Old Enough for Unix (Honorary Member Emeritus)
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
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
script(1) starts my $SHELL allright but it sets argv 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)
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
Script done, output file is typescript
neat bash prompt (time, date, hostname, bells, whistles) hello$
No particular need for script(1) to set argv to anything in
particular, is there?
Just do execv (shellname, shellname, options, (char *) NULL)
instead of execv (shellname, "sh", options, (char *) NULL)