From: Stanislav Brabec <sbrabec@suse.cz>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 0/3] script: no logging for non-interactive shells
Date: Wed, 11 Feb 2015 15:07:52 +0100 [thread overview]
Message-ID: <54DB6238.5080306@suse.cz> (raw)
In-Reply-To: <20150211100528.GA32133@ws.net.home>
Karel Zak wrote:
> Would be better to learn people to fix their shell initialization
> files to not call script(1) for non-interactive sessions?
It makes sense.
>From 8fff32e65399ae07f70e12568d4d5278725673a7 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec@suse.cz>
Date: Wed, 11 Feb 2015 15:02:10 +0100
Subject: [PATCH] script.1: Document behavior in non-interactive shells
And discourage users from such use.
---
term-utils/script.1 | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/term-utils/script.1 b/term-utils/script.1
index 4573f07..f32030c 100644
--- a/term-utils/script.1
+++ b/term-utils/script.1
@@ -121,6 +121,26 @@ create garbage in the typescript file.
.B script
works best with commands that do not manipulate the screen, the results are
meant to emulate a hardcopy terminal.
+.PP
+It is not recommended to run
+.B script
+in non-interactive shells. The inner shell of
+.B script
+is always interactive, and this could lead to unexpected results. If you use
+.B script
+in the shell initialization file (profile), you should use e. g.
+.RS
+.RE
+.sp
+.na
+.RS
+.nf
+if test -t 0 ; then
+ script
+fi
+.fi
+.RE
+.PP
.SH ENVIRONMENT
The following environment variable is utilized by
.BR script :
--
2.2.2
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz
Lihovarská 1060/12 tel: +49 911 7405384547
190 00 Praha 9 fax: +420 284 084 001
Czech Republic http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
next prev parent reply other threads:[~2015-02-11 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 21:30 [PATCH 0/3] script: no logging for non-interactive shells Stanislav Brabec
2015-02-11 10:05 ` Karel Zak
2015-02-11 14:07 ` Stanislav Brabec [this message]
2015-02-12 13:31 ` 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=54DB6238.5080306@suse.cz \
--to=sbrabec@suse.cz \
--cc=kzak@redhat.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