Last modified: 2021-05-21
This is a course page of
David Casperson
Associate Professor
Computer Science
University of Northern British Columbia

CPSC 100 — Computer Programming I — Fall 2011

Picture of what script does

Without script
Data flow without script
With script
Data flow with script

How to use script and scriptfix

What script does

The script program intercepts communication between the shell (the program that prints the “%” signs) and the keyboard and terminal window, and duplicates it and copies it to a file.

To use script

  • Type
    script scriptfilename
    to begin capturing information in a script file.
  • Do what you would normally do.
  • Type control-D to quit the script session.

What scriptfix does

The scriptfix removes control codes (like backspace characters, and instructions that cause inverse video) from the scriptfile.

This is necessary because script just splits the program output in two. Information that is useful to the terminal window is not useful in the scriptfile.

To use scriptfix

  • Type
    /opt/scriptfix/scriptfix scriptfilename > cleanfilename
    to put a clean copy of scriptfilename in the file cleanfilename
[This section corrected 2011-09-28 21:41:03 based on suggestions from Heinrich Butow.]
Home page Semesters Site Map
go back Fall 2011 go forward
2024-12 other links

CPSC 100 [Other years]
Dates
Policies
Labs
Old Exams
How to use scriptfix
Blackboard Link
CPSC 370 [Other years]
Java
David’s Schedule

fall-2024