script(1)
Name
script − generate script of your terminal session
Syntax
script [−a] [file]
Description
The script command calls a forked shell and then makes a typescript of everything printed on your terminal. The typescript is written to file, or appended to file if the −a option is given. If no file name is given, the typescript is saved in the file typescript . Later, it can be sent to the line printer with lpr.
When script is run, it will execute your .cshrc file and will also put you under control of a new pty. The script program ends when the forked shell exits.
This program is useful when using a crt and you want a hard-copy record of the dialog. An example of how script can be used is a student handing in a program that was developed on a crt when hard-copy terminals are in short supply.
Options
−aAppends output to the output file.
Restrictions
Because the script command uses a second pair of pseudo ttys, some commands will fail when run under script. For example, the whoami command may not always return a username.
Also, the vi editor can be affected by script. The vi commands j, k, h, and l that are used to move the cursor, do not always function properly. If the screen becomes garbled when using these commands, use <ctrl> L to refresh the screen.