diff options
author | Stanislav Brabec | 2015-02-11 15:07:52 +0100 |
---|---|---|
committer | Karel Zak | 2015-02-12 14:31:16 +0100 |
commit | 8fd4a7aa81d2bd65dd586a6c0de989d1abdae8a4 (patch) | |
tree | 1dfb66bd6dffdb38b3f29e99ea42e4f6b17a9c6b /term-utils/script.1 | |
parent | libmount: read utab always when read mtab from /proc (diff) | |
download | kernel-qcow2-util-linux-8fd4a7aa81d2bd65dd586a6c0de989d1abdae8a4.tar.gz kernel-qcow2-util-linux-8fd4a7aa81d2bd65dd586a6c0de989d1abdae8a4.tar.xz kernel-qcow2-util-linux-8fd4a7aa81d2bd65dd586a6c0de989d1abdae8a4.zip |
script: no logging for non-interactive shells
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.
Diffstat (limited to 'term-utils/script.1')
-rw-r--r-- | term-utils/script.1 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/term-utils/script.1 b/term-utils/script.1 index 4573f0735..e130c77d9 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 : |