aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/script/script.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2010-10-14 03:13:20 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2010-10-14 03:13:20 +0000
commitcfd21e91da67c307e92e153356630a045c6f96b7 (patch)
tree09eb7c79e6af068e6ceee9e84f2bcd6b8ccc0815 /usr.bin/script/script.c
parent9681108efc22168640fcc7b2cd87a6e33aa7f822 (diff)
Notes
Diffstat (limited to 'usr.bin/script/script.c')
-rw-r--r--usr.bin/script/script.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index ad706dcdd350..b10b7e659cee 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -241,14 +241,21 @@ void
doshell(char **av)
{
const char *shell;
+ int k;
shell = getenv("SHELL");
if (shell == NULL)
shell = _PATH_BSHELL;
+ if (av[0])
+ for (k = 0 ; av[k] ; ++k)
+ fprintf(fscript, "%s%s", k ? " " : "", av[k]);
+ fprintf(fscript, "\r\n");
+
(void)close(master);
(void)fclose(fscript);
login_tty(slave);
+ setenv("SCRIPT", fname, 1);
if (av[0]) {
execvp(av[0], av);
warn("%s", av[0]);