[Homepage] | [Next: Redirecting Output] | [Up: Creating Output] | [Prev: Creating Output]

Using script

One way to create an output file is to use script. After running this command, everything which shows on the screen is also logged to a file named typescript, until you type exit. Consider the example below where a program mi2km is executed:

% script
Script started on Tue Apr 2 23:30:56 1996
% ls
Tests/        mi2km*        mi2km.c       typescript 
% mi2km
Enter the distances in miles> -23.4

-23.4 miles is -37.6506 kilometers.
% mi2km
Enter the distances in miles> 92e6

9.2e+07 miles is 1.48028e+08 kilometers.
% exit

script done on Tue Apr  2 23:32:02 1996

The contents of typescript are just what you see above; you can see that I ran mi2km twice.


Ewerton L. Madruga
Modified by Kevin Klenk