script: --quiet option is not quiet.
PATCH 1/1 script: --quiet option is not quiet.
From: James Hunt <[email protected]>
Specifying 'script --quiet ...' still produces the 'Script started' message in the typescript file. The --quiet option implies that the script program should not log any of its output to the typescript file.
Originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693966
Signed-off-by Andreas Henriksson <[email protected]>
--- term-utils/script.1 | 3 ++- term-utils/script.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
term-utils/script.1 +2 -1
@@ -82,7 +82,8 @@ Allow the default output destination, i.e. the typescript file, to be a hard or symbolic link. The command will follow a symbolic link. .TP \fB\-q\fR, \fB\-\-quiet\fR -Be quiet. +Be quiet (do not write start and done messages to either standard output +or the typescript file). .TP \fB\-t\fR, \fB\-\-timing\fR[=\fIfile\fR] Output timing data to standard error, or to
term-utils/script.c +2 -1
@@ -437,7 +437,8 @@ dooutput(void) { tvec =time ((time_t *)NULL );my_strftime (obuf,sizeof obuf,"%c\n" ,localtime (&tvec)); -fprintf (fscript,_ ("Script started on %s" ), obuf); +if (!qflg) +fprintf (fscript,_ ("Script started on %s" ), obuf);FD_ZERO (&readfds);
Signature · 1 line
2.0.0
PATCH 2/2 script: silence the done message on --quiet as well
Apparently James Hunts patch (which he provided a long time ago) is no longer covering it all.
This followup patch also silences the "Script done ..." message when --quiet is used.
Signed-off-by Andreas Henriksson <[email protected]>
--- term-utils/script.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
term-utils/script.c +2 -1
@@ -578,7 +578,8 @@ done(void) {char buf[BUFSIZ ]; tvec =time ((time_t *)NULL );my_strftime (buf,sizeof buf,"%c\n" ,localtime (&tvec)); -fprintf (fscript,_ ("\nScript done on %s" ), buf); +if (!qflg) +fprintf (fscript,_ ("\nScript done on %s" ), buf);if (close_stream (fscript) !=0 )errx (EXIT_FAILURE ,_ ("write error" ));
Signature · 1 line
2.0.0
Karel Zak
maintainerQuoted 3 lines · Andreas Henriksson
term-utils/script.1 | 3 ++- term-utils/script.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Both patches applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com