Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 12085 Details for
Bug 21147
util-linux patch to improve the "script" command
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch to enhance the "script" command
util-linux-2.11z-script.patch (text/plain), 1.54 KB, created by
Wayne Davison
on 2003-05-17 03:27:22 UTC
(
hide
)
Description:
The patch to enhance the "script" command
Filename:
MIME Type:
Creator:
Wayne Davison
Created:
2003-05-17 03:27:22 UTC
Size:
1.54 KB
patch
obsolete
>--- util-linux-2.11z/misc-utils/script.1 2002-01-12 11:45:00.000000000 -0800 >+++ ./misc-utils/script.1 2003-05-12 16:40:34.000000000 -0700 >@@ -40,6 +40,7 @@ > .Sh SYNOPSIS > .Nm script > .Op Fl a >+.Op Fl c Ar COMMAND > .Op Fl f > .Op Fl q > .Op Fl t >@@ -69,6 +70,10 @@ > or > .Pa typescript , > retaining the prior contents. >+.It Fl c Ar COMMAND >+Run the COMMAND rather than an interactive shell. >+This makes it easy for a script to capture the output of a program that >+behaves differently when its stdout is not a tty. > .It Fl f > Flush output after each write. This is nice for telecooperation: > One person does `mkfifo foo; script -f foo' and another can >--- util-linux-2.11z/misc-utils/script.c 2002-11-26 08:18:00.000000000 -0800 >+++ ./misc-utils/script.c 2003-05-12 16:33:27.000000000 -0700 >@@ -91,6 +91,7 @@ > char line[] = "/dev/ptyXX"; > #endif > int aflg = 0; >+char *cflg; > int fflg = 0; > int qflg = 0; > int tflg = 0; >@@ -135,11 +136,14 @@ > } > } > >- while ((ch = getopt(argc, argv, "afqt")) != -1) >+ while ((ch = getopt(argc, argv, "ac:fqt")) != -1) > switch((char)ch) { > case 'a': > aflg++; > break; >+ case 'c': >+ cflg = optarg; >+ break; > case 'f': > fflg++; > break; >@@ -284,6 +288,7 @@ > > void > doshell() { >+ char *opt = cflg? "-c" : "-i"; > /*** > int t; > >@@ -301,9 +306,9 @@ > (void) dup2(slave, 2); > (void) close(slave); > #ifdef __linux__ >- execl(shell, strrchr(shell, '/') + 1, "-i", 0); >+ execl(shell, strrchr(shell, '/') + 1, opt, cflg, 0); > #else >- execl(shell, "sh", "-i", 0); >+ execl(shell, "sh", opt, cflg, 0); > #endif > perror(shell); > fail();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21147
:
12084
| 12085