|
|
Understanding Your System: HP 3000 Series 9X8LX Computer Systems > Chapter 7 CommandsHelp with Commands |
|
If you look at the PURGE command in the book Command Reference - HP 3000 Series 9X8LX (B3820-90007), you will find, under the heading Syntax, a curious-looking entry:
This method of showing a command and its parameters is called a syntax diagram. Filereference looks unfamiliar. It is simply the formal name of the (required) parameter for specifying a file to erase.
On the command line, you would enter a suitable value (a name, a word, a number) to achieve the results that you want, just as you enter PURGE ACCTRPTReturn to remove a file called ACCTRPT. In this case, the information ACCTRPT is the actual parameter.
Filereference is a required parameter. It follows the name of the command, and there are no square brackets around it. Filereference suggests that some reference to a file is called for. In this case, it calls for the name of a file. You may find ,TEMP unfamiliar, too. It is an optional parameter. It is also a keyword. There is more on information on keywords in “Variables and keywords” and in “Syntax diagrams”. In the syntax diagram, the square brackets ( [ ] ) surrounding ,TEMP signify that using ,TEMP is optional. You may use it or omit it according to your need. If you choose to use it, you must include the comma that precedes TEMP, as in this example:
This command line removes a temporary file named K0356774 from the disk. If no such temporary file exists, the operating system displays an warning message telling you that it could not find that (temporary) file. Syntax diagrams help in understanding the parts of a command--its parameters--their use, and their relationship to each other. When the command is a simple one, its syntax diagram is relatively easy to follow. But when the command is complex, when it has many parameters, its syntax diagram does appear formidable. But, despite any potential complexity, all syntax diagrams follow simple rules. What follows is not a complete lesson in reading syntax diagrams. Instead, it is an introduction intended to make syntax diagrams look a little less formidable. The syntax diagram for the PURGE command is simple.
The parameter filereference is in italic lettering to indicate that it is a variable. Entering PURGE filereferenceReturn would produce an error. Because filereference is in italics, you must use the name of a file in its place when you execute the PURGE command:
What is a variable? You might think of it as an empty box. Until you put something inside it, the box is just an empty box. When you put something inside it, it becomes a box of.... What did you put inside the box? For a computer, a variable is much like an empty box. It is an area of memory waiting for something to fill it. In a syntax diagram, a formal name such as filereference represents just such an empty box. But filereference is also a parameter of the command PURGE. For PURGE, the parameter filereference is a variable. That means that when you execute PURGE, it will look for something in a memory box called filereference. If it finds the name of an existing file, it erases that file. You put the name of a file into that memory box when you execute PURGE this way:
Since filereference is a required parameter of PURGE, the command expects to find something in the filereference memory box. If it finds nothing (because you left out the name of a file), it reports an error to the computer and the computer puts an error message on your video screen.
will not work. 6 is not the name of a file, but a number.
will work, if X6 is the name of a file in your current group and if the file is not protected in some way.
Optional parameters are variables, too, but with a difference. The LISTFILE command serves as an example. Its syntax diagram includes this parameter:
Here, filename is an optional parameter. There is a memory box called filename, too. But for LISTFILE that box always has something in it. What is there is a value that says: all files in the group. And that is what LISTFILE displays if you do not specify a file name. Unlike PURGE with its required parameter, LISTFILE can be quite happy even if you do not specify a file name (because there is always something for it to find in the memory box called filename).
When you specify a file name in this fashion, the file ACCTRPT goes into the memory box called filename. When LISTFILE peeks into that memory box, it finds--not "all files in the group," but the name of one particular file, ACCTRPT.
Under the Parameters heading of the PURGE command in the Command Reference - HP 3000 Series 9X8LX (B3820-90007), you will find a description of each parameter of the PURGE command. That description tells you what is appropriate to use. Look again at the syntax diagram for PURGE.
,TEMP is also a parameter. It happens to be optional, too, because it is surrounded by brackets. But it is not a variable. It is a keyword. It appears in uppercase letters. It instructs PURGE to remove a temporary file, rather than a permanent one. A keyword is not a variable. It is not an empty box into which you can put what you like. In order to use a keyword, you must enter the keyword exactly as it appears in the syntax diagram. You may enter the word in uppercase letters or in lowercase letters. Entering this:
will produce an error. In fact, entering anything other than ,TEMP after the name of a file will produce an error. Because TEMP is optional, you do not have to use it when you enter the command. But if you do decide to use it (in order to erase a temporary file), TEMP is the only value that PURGE can accept. There are valuable "clues" in any syntax diagram: Table 7-2 Syntax Elements
|
|