diff options
author | Stanislav Brabec | 2015-02-13 19:59:22 +0100 |
---|---|---|
committer | Karel Zak | 2015-02-16 10:49:36 +0100 |
commit | ab52a8bcce2f01bb44d3c2266e19b32e9639084b (patch) | |
tree | f938f29a44c2d494dd4d01f2ab01849543966eab /term-utils/script.1 | |
parent | script: no logging for non-interactive shells (diff) | |
download | kernel-qcow2-util-linux-ab52a8bcce2f01bb44d3c2266e19b32e9639084b.tar.gz kernel-qcow2-util-linux-ab52a8bcce2f01bb44d3c2266e19b32e9639084b.tar.xz kernel-qcow2-util-linux-ab52a8bcce2f01bb44d3c2266e19b32e9639084b.zip |
script.1: Improve documentation of non-interactive behavior
- use exit in .profile to avoid non-logged session after typing "exit"
- document that script can read more from stdin than the command inside:
echo -e 'script -c "read a b ; echo a=\$a b=\$b >defs.sh"\n1 2\necho Done' | sh
Script started, file is typescript
1 2
echo Done
Script done, file is typescript
Diffstat (limited to 'term-utils/script.1')
-rw-r--r-- | term-utils/script.1 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/term-utils/script.1 b/term-utils/script.1 index e130c77d9..6b566fe5e 100644 --- a/term-utils/script.1 +++ b/term-utils/script.1 @@ -128,7 +128,8 @@ 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. +in the shell initialization file, you have to avoid entering an infinite +loop. Use e. g. profile file, which is read by login shells only: .RS .RE .sp @@ -137,10 +138,15 @@ in the shell initialization file (profile), you should use e. g. .nf if test -t 0 ; then script + exit fi .fi .RE .PP +You should also avoid use of script in command pipes, as +.B script +can read more input than you would expect. +.PP .SH ENVIRONMENT The following environment variable is utilized by .BR script : |