|
|
Using HP 3000 MPE/iX: Fundamental Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 7 Command FilesLesson 2 Naming Conflicts |
|
One day you will probably create a command file and keep it with a name you like, only to discover that the computer executes something entirely different when you enter the name of the command file. File names within a group must be unique. But identical file names may exist in different groups. If your command file has the same name as an MPE/iX command, the computer might execute that other command and not the command file that you created.
Create a command file that lists all of the file names in your account. It should look like this when you create it in the editor:
Keep this file as SHOWVAR. Execute it. What happened? Did you get the following on the screen?
This is not what you would expect. What happened? SHOWVAR is an MPE/iX system command, and that is what the computer executed, instead of your command file SHOWVAR. There are two ways to avoid file name duplication.
The MPE/iX system tries to interpret everything that you type at the prompt as an instruction of some kind. This includes MPE/iX system commands, programs, utilities, subsystems, and user-created executable files, such as command files. If you are a new user of the MPE/iX system, you certainly cannot know all of the instructions that MPE/iX will accept. But you should always try to keep your file names from duplicating the names of other commands on the system. Before you name a command file, check with the system first to see whether the name that you want for your command file is already in use. Use the help facility to do this. At the MPE XL prompt, enter:
Since there is a SHOWVAR MPE/iX system command, you get the help facility display.
Enter:
Something like the following appears on the screen if your proposed file name matches the name of another executable file on the system.
Try it. Something like this appears on the screen if your proposed file name matches a program file (or subsystem/utility) on the system.
The SORT command is an instruction already in the system. Saving your command file as SORT would be pointless. Try the name GLOBAL:
You see this message if the name that you select is unique to the system. You could, therefore, keep a command file called GLOBAL and successfully execute it without getting surprising results, but...there is always an exception.
The MPE/iX command XEQ bypasses system commands, programs, utilities, and subsystems and executes command files -- even in the case of name duplication. Try executing your SHOWVAR command file using the XEQ command:
This time your command file called SHOWVAR should execute and display the output from its one command, LISTFILE @.@. Using XEQ along with your command file name does avoid potential naming conflicts, but renaming your command file to avoid naming conflicts also avoids any confusion over the purpose of two identically named, executable files. |
|