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$
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.
State Changed From-To: open->closed Fixed in rev 1.10, MFC to rev 1.9.2.1 on RELENG_3.