|Creating Files for SHAZAM|
Use a Unix workstation, or a personal computer with terminal emulation software, to connect to the Unix system. You will then use a Unix editor to create a Shazam command file. For beginning users, "pico" is recommended as a full-screen editor, as it is fairly easy to use without referring to a manual.
To use pico to create a file of Shazam commands, you enter the following command at the Unix command prompt:
where shazam1 is the name you have chosen for this particular Shazam program file. Note that Unix is case sensitive. You must type "pico" in lowercase. You cannot use "shazam1", "Shazam1", and "SHAZAM1" interchangeably; they would be three different files.
Simply type in your Shazam commands. Across the bottom of your screen, pico will display the editor control sequences. The character "^" is used to represent the Control or "Ctrl" key, so,
^V Next Pg
means "Hold down the CTRL key and press V to move down the file". You can use the arrow keys to move around the screen and make changes. Use "^D" to delete unwanted characters. Pressing "Enter" when at the end of a line creates a blank line after the cursor position. Pressing "Enter" when positioned at the beginning of a line creates a blank line before the cursor position. Pressing "backspace" at the beginning of a line joins the line to the one before. Pressing "Enter" in the middle of a line cuts the line in two at that point. "^X" is used to save the file and quit the pico editor.
To run a batch Shazam job in Unix, the format of the command is:
shazam < input_file > output_file &
shazam < shazam1 > results1 &
The character "&" at the end of the command tells the operating system to run the command in the background. If you leave it out, the job runs in the foreground. This simply means that your terminal will be locked until the command finishes. So the "&" is not really important for short jobs.
You should chose the name of "output_file" carefully. If it does not already exist in your current Unix directory, it will be created. However, if it does already exist, the contents will be replaced by the new Shazam output. Be careful not to overwrite a file that you still need. If you forget to enter " > output_file" then the Shazam results will be displayed on your screen. They may scroll by too fast to read. To slow this down, you would send the output into a pager program. For example:
shazam < shazam1 | more
This will run shazam as a foreground job and use the pager "more" to let you view the results at your own pace.
If you used the earlier example to send the Shazam output to a file, you could view the results when the job is finished using the more command. For example:
To run shazam interactively, enter:
Since you are running in the foreground, and have not used redirection (the "<" and ">" characters) to supply input and output file names, your terminal will be used for both input and output. The three most important commands to remember when running Shazam interactively are "help", "demo", and "stop".
If you are running shazam interactively, using your keyboard for input instead of redirecting the Shazam commands from a file, then your only recourse in the event of error is to type the commands again. (Use "help" or the manual to help you identify the error.)
If you have stored your Shazam commands in a file, then you simply call up the editor again, find the errors, make changes, and save the file. Run shazam again to see if your corrections worked as expected.
At some point, you will want to print out a copy of your Shazam programs, its results, or both. This is done with an lpr command.
Example 1 -- print Shazam input file at Dafoe:
lpr -Pdafoe shazam1
Example 2 -- print Shazam output at the Copy Centre (charged printing):
a2ps -Pcopyctr -l results1
Example 1 prints the program you wrote using the standard forms on the Dafoe line printer. Example 2 uses a2ps translates the output file from ascii text to PostScript and prints it in landscape orientation on the laser printer in the Campus Copy Centre.
Most commands on Unix have an associated "manual page" that you can read to find out more about the command. These generally tell you about the command itself, not how to write the program code for the package. To display one of these on your screen, type "man" followed by the command name. For shazam that would be:
There are published manuals for Shazam. Reference copies can be found in the Science, Agriculture and Management Libraries.