![]() |
![]() |
|
|
![]() |
![]() |
Using HP 3000 MPE/iX: Fundamental Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 7 Command Files![]() Lesson 1 Using Command Files |
|
Lesson 1 presents creating and using command files.
A command file:
At its simplest, a command file is an MPE/iX command that you shorten. For example, instead of typing in the whole command SHOWTIME, that you can use the editor to create a command file called ST that contains the command SHOWTIME. You save it and leave the editor. Every time that you enter STReturn at the system prompt, SHOWTIME executes. Get into the editor. Create a one-line file. The only line that you need is SHOWTIME. It will look like this on the screen:
You have a command file called ST. Enter:
What happens on the screen? Another example of a one-line command file is PR. It prints the last three lines of the file DOCUMENT to the terminal screen. (Of course, you would have difficulty if the file has fewer than three lines.) Get into the editor now. Create a new file by doing the following:
Exit the editor. Execute the command file PR by doing the following:
You should see on the screen the last three lines of the file DOCUMENT that you created in module 3. Suppose that you created a command file that has this one line:
What would this command file do? This command file would list all of the files in the PUB group of your account. If this file were to be kept as PUBLIST, look at how many keystrokes that you would save each time this command file was executed. Create and execute this command file, PUBLIST. One command file can call upon and execute another command file. The example below shows what that you might put in a command file named PS. It executes the command file PR and then executes the command file ST. Try it. Create the file in the editor, just as it appears below.
Save the file as PS and exit out of the editor. To execute it, enter the following:
Do you see the last three lines of the DOCUMENT file and the date and time on the screen?
|
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|