UNIX Shells by Example (4th Edition)

 <  Day Day Up  >  

script ”creates a typescript of a terminal session

script [ a ] [ filename ]

script makes a typescript of everything printed on your terminal. The typescript is written to a filename. If no filename is given, the typescript is saved in the file called typescript . The script ends when the shell exits or when Ctrl-D is typed.

Example A.48.

1 script 2 script myfile

EXPLANATION

  1. Starts up a script session in a new shell. Everything displayed on the terminal is stored in a file called typescript. Must press ^d or exit to end the session.

  2. Starts up a script session in a new shell, storing everything displayed on the terminal in myfile. Must press ^d or exit to end the session.

 <  Day Day Up  >  

Категории