Software Design
Gathering Information on Unix

There are three Unix commands that are often useful when you are sending in questions. The command history prints out a list of the last few hundred commands you have run. You can type history>temp.txt to put these commands in a file, then cut and paste from that file to send me (or the newsgroup) the exact commands that you wrote.

The second useful command is set, with no argument. This prints out all of your environment variables, and their current values. Again, cut and paste from this to show me what your CVSROOT, CVS_RSH, and other environment variables are.

Finally, there is a command called script (with no arguments). When you run this command, you immediately get back your usual command-line prompt (in my case, a dollar sign). However, Unix is then recording everything you type, and everything that is printed to your screen, in a file called typescript. This file is created in the directory you were in when you ran script. When you are done recording, type ctrl-D (that's the control key and the "D" key at the same time). Ctrl-D means "end of input" in Unix; in this case, it tells the script command to stop recording things. If you take a look in the file typescript, you will then see every typing mistake, newline character, and so forth. You can cut and paste from this file to show people exactly what you did.

Warning: please make sure you don't accidentally include sensitive information (like your student number) when posting information that you collect this way.


$Id: gathering-info.html,v 1.1 2007/01/02 01:57:49 reid Exp $