[Next] [Previous] [Up] [Top] [Contents]

4.1 System Resources

4.1.9 script - record your screen I/O

script creates a script of your session input and output. Using the script command, you can capture all the data transmission from and to your terminal screen until you exit the script program. This can be useful during the programming-and-debugging process, to document the combination of things you have tried, or to get a printed copy of it all for later perusal.

Syntax

script [-a] [file] <. . .> exit

Common Options

-a append the output to file

typescript is the name of the default file used by script.

You must remember to type exit to end your script session and close your typescript file.

Examples

beauty condron>script

Script started, file is typescript

beauty condron>ps

PID TT STAT TIME COMMAND

23323 p8 S 0:00 -h -i (tcsh)

23327 p8 R 0:00 ps

18706 pa S 0:00 -tcsh (tcsh)

23315 pa T 0:00 emacs

23321 pa S 0:00 script

23322 pa S 0:00 script

3400 pb I 0:00 -tcsh (tcsh)

beauty condron>kill -9 23315

beauty condron>date

Mon Apr 22 22:29:44 EDT 1996

beauty condron>exit

exit

Script done, file is typescript

[1] + Killed emacs

beauty condron>cat typescript

Script started on Mon Apr 22 22:28:36 1996

beauty condron>ps

PID TT STAT TIME COMMAND

23323 p8 S 0:00 -h -i (tcsh)

23327 p8 R 0:00 ps

18706 pa S 0:00 -tcsh (tcsh)

23315 pa T 0:00 emacs

23321 pa S 0:00 script

23322 pa S 0:00 script

3400 pb I 0:00 -tcsh (tcsh)

beauty condron>kill -9 23315

beauty condron>date

Mon Apr 22 22:29:44 EDT 1996

beauty condron>exit

exit

script done on Mon Apr 22 22:30:02 1996

beauty condron>


Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]