diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 2010-10-14 01:21:44 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 2010-10-14 01:21:44 +0000 |
| commit | ce4bdc460dac37e6ffb0b5d63d6bd47d2fc72346 (patch) | |
| tree | edbccb1c66ee0bbb378b69b0e54aeb737db9169b /usr.bin/script/script.c | |
| parent | 615f7298ee9436c84f3461ad4fdf75ba9561129d (diff) | |
Notes
Diffstat (limited to 'usr.bin/script/script.c')
| -rw-r--r-- | usr.bin/script/script.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index b571606726e2..5d20127c68b6 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -236,14 +236,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]); |
