MirOS Manual: script(1)

SCRIPT(1)                    BSD Reference Manual                    SCRIPT(1)

NAME

     script - make typescript of terminal session

SYNOPSIS

     script [-alqsU] [-c cmd] [-L|U replstr] [-n | file]

DESCRIPTION

     script opens a pseudo-tty master and starts an interactive shell which is
     connected to the slave tty. If the -n option is not given, it makes a
     typescript of everything printed on your terminal. It is useful for stu-
     dents who need a hardcopy record of an interactive session as proof of an
     assignment, as the typescript file can be printed out later with lpr(1).
     It is also useful for people who log in to a MirOS box with a terminal
     that is not UTF-8 capable, or to connect to a non-UTF-8-capable box.

     If the argument file is given, script saves all dialogue in file. If no
     file name is given, the typescript is saved in the file typescript.

     The options are as follows:

     -a      Append the output to file or typescript, retaining the prior con-
             tents.

     -c cmd  Instead of running ${SHELL:-/bin/sh} -i, execute
             ${SHELL:-/bin/sh} -c 'cmd'.

     -L replstr
             Assume the terminal uses ISO-8859-1 ("latin1") encoding, and con-
             vert from and to UTF-8 for the pty. Inconvertible characters are
             displayed as replstr, one per column.

     -l      Assume the terminal uses ISO-8859-1 ("latin1") encoding, and con-
             vert from and to UTF-8 for the pty. Inconvertible characters are
             displayed as one question mark per column.

     -n      Do not record a typescript.

     -q      Be quiet.

     -s      Start a login shell.

     -U replstr
             Assume the session uses ISO-8859-1 ("latin1") encoding, and con-
             vert from and to UTF-8 for the pty. Inconvertible characters are
             sent to the inside shell as replstr, one per column.

     -u      Assume the session uses ISO-8859-1 ("latin1") encoding, and con-
             vert from and to UTF-8 for the pty. Inconvertible characters are
             sent to the inside shell as one question mark per column.

     The script ends when the forked shell exits (a control-D ('^D') to exit
     the Bourne shell (sh(1)), and exit, logout, or control-D (if ignoreeof is
     not set) for the C-shell, csh(1)). script will exit with the status of 0
     unless any of its child processes fail. In which case, script will return
     1.

     Certain interactive commands, such as vi(1), create garbage in the
     typescript file. script works best with commands that do not manipulate
     the screen; the results are meant to emulate a hardcopy terminal.

ENVIRONMENT

     SHELL  Name of the shell to be forked by script. If not set, the Bourne
            shell is assumed. (Most shells set this variable automatically.)

EXAMPLES

     $ script

     Records a typescript of an interactive session.

     $ script -ln

     Runs a UTF-8 session inside an ISO-8859-1 hardware terminal.
     /usr/ports/misc/screen can do even more, but is not part of MirOS.

     $ luit -encoding 'ISO 8859-1' -- ssh remote

     Run inside the UTF-8 session, connects to a remote system which uses
     ISO-8859-1 encoding and ISO 2022 shift sequences.

     $ script -unc ssh remote

     This is the same, without luit. ISO-8859-1 for the inside is hard-coded.

SEE ALSO

     luit(1), screen(1)

HISTORY

     The script command appeared in 3.0BSD. Support for recoding between la-
     tin1 and utf-8 appeared in MirOS #10.

AUTHORS

     The recoding, execute shell command code, and codeset support was au-
     thored by Thorsten Glaser <tg@mirbsd.de>.

BUGS

     script places everything in the log file, including linefeeds and back-
     spaces. This is not what the naive user expects.

     While double-width characters are presented as two times the replstr,
     combining characters are hidden. xterm(1) does some sort of precomposing
     and then displays them together as single character, or, as replacement
     if it stands - cf. /usr/src/contrib/samples/utf-8 - alone. script just
     doesn't display them at all. GNU screen has a different, also slightly
     broken, logic and has even worse width behaviour in that file, but re-
     places unicode line-drawing characters with their ACS equivalents.

MirOS BSD #10-current         September 6, 2009                              1

Generated on 2014-07-04 21:17:45 by $MirOS: src/scripts/roff2htm,v 1.79 2014/02/10 00:36:11 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002‒2014 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.