public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Henriksson <andreas@fatal.se>
To: util-linux@vger.kernel.org
Cc: James Hunt <james.hunt@ubuntu.com>,
	Andreas Henriksson <andreas@fatal.se>
Subject: [PATCH] script: --quiet option is not quiet.
Date: Sun, 22 Jun 2014 01:03:04 +0200	[thread overview]
Message-ID: <1403391784-9912-1-git-send-email-andreas@fatal.se> (raw)

From: James Hunt <james.hunt@ubuntu.com>

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 <andreas@fatal.se>
---
 term-utils/script.1 | 3 ++-
 term-utils/script.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/term-utils/script.1 b/term-utils/script.1
index 60a0e53..67e1066 100644
--- a/term-utils/script.1
+++ b/term-utils/script.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
diff --git a/term-utils/script.c b/term-utils/script.c
index 1530e67..21fb5af 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -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);
 
-- 
2.0.0


             reply	other threads:[~2014-06-21 23:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-21 23:03 Andreas Henriksson [this message]
2014-06-22  1:12 ` [PATCH 2/2] script: silence the done message on --quiet as well Andreas Henriksson
2014-06-23  9:42 ` [PATCH] script: --quiet option is not quiet Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403391784-9912-1-git-send-email-andreas@fatal.se \
    --to=andreas@fatal.se \
    --cc=james.hunt@ubuntu.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox