Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/ftp/documents/system-docs/vms-guide/html/VUG_15.html
Дата изменения: Wed Nov 1 17:38:23 1995 Дата индексирования: Sun Dec 23 18:29:52 2007 Кодировка: Поисковые слова: п п п п п п п п п п п п п п |
$
) prompt.*1 This section describes only a subset of DCL--including some commands with which you may already be familiar. The following topics are described in this section:
COMMAND/QUALIFIER parameter/qualifierThe command itself is always the first element to be entered on the command line. Commands can be abbreviated to a few letters, generally, four or less. For example, the
TYPE
can be entered using only the letters TY
.
A qualifier is an option. Qualifiers can be used to modify the effect of the DCL command or to specify additional information to the command. Qualifiers can be specified either immediately after the command, or after the parameters--or both. Wherever the qualifier is placed, it is always preceded with a slash (
For example, Figure 2.1 shows a simple
If you make a mistake while typing, you can press the
On some terminals, pressing
Table 2.5 describes some of the most important control operations.
Generated with CERN WebMaker
/
). More than one qualifier can be used with any command or parameter at a time.DIRECTORY
command to tell the system to display a listing of all files in the current directory. The command is then reissued, but this time with the SIZE
and DATE
qualifiers; SIZE
lists the amount of disk space each files uses, DATE
lists the file creation date and time. Sizes are expressed in blocks, each of which is 512 bytes.
Figure 2.1: Qualifiers Modify the Behavior of Commands
The example in Figure 2.1 shows how a qualifier can be specified by placing the switch next to the command, but as we mentioned earlier, the switch can also be placed next to the parameters. For example, in Figure 2.2, qualifiers are placed next to both the command and the parameter. In the following PRINT
command, the qualifier next to the command tells the system which printer to use, while the qualifier next to the parameter specifies the number of copies to be printed.
Figure 2.2: Qualifiers Used with a PRINT Command
Parameters are the objects on which the command operates. The parameters needed for each command are listed in the OpenVMS DCL Dictionary, or in the online help (accessed by typing the HELP
command, which takes the name of the command you want to know about as an optional parameter). For example, to see what parameters can be used with the DIRECTORY
command, you could type:
$ HELP DIRECTORY
The help facility would tell you, for example, that the DIRECTORY
command can take, as a parameter, the name of a specific directory other than the current default directory (directories are discussed in more detail on page 48). For example, if you want to see what files can be accessed in the top level directory of STSDAS, you could type the following command:
$ DIRECTORY DISK$STSDAS:[STSDASX.PKG]
The system will prompt you for parameter values if you don't specify a value for a command's required parameters. Basic Commands
The following table lists some of the most commonly-used DCL commands. Remember that DCL commands are issued in response to the system prompt ($
). If you need more information about these commands, use the online help facility. Keep in mind that commands can be abbreviated.
Table 2.1: Key DCL Commands
Let's look at each of these commands in a bit more detail.
@
- The @
character is used to execute a command procedure, which is a text file consisting of DCL commands. (See "Procedures" on page 24 and "Batch Jobs" on page 33 for more information about command procedures.) Command procedures generally have a file type of .COM
, and if another file type is used, then it must be explicitly specified every time the procedure is executed. For example:
$ @LOGIN.DAT
CC
- Run the C compiler on a source file. C programs should have a file type of .C
. The compiler will create an object file that is then linked using the LINK
command, as described on page 125. Example:
$ CC CALCCOORDS
COPY
- Make a copy of a file, preserving the original. The COPY
command is described in more detail on page 47. Example:
$ COPY MANUAL.TEX WRKNG_MANUAL.TEX
CREATE
- Create a new file containing input from the keyboard. The CREATE
command is described in more detail on page 46. The keyboard input is terminated by pressing
-
. Example:
Figure 2.3: Creating a File
DELETE
- Delete a file. This command requires that a version number (or wildcard) be used. The DELETE
command will be described in more detail on page 47. Example:
$ DELETE APJ_LETTER.TEX;12
DIRECTORY
- List files in the current directory. Several options are available--see the on-line help for details. Example:
$ DIRECTORY
FORTRAN
- Run the FORTRAN compiler on a program source file. This will create the object file that is then linked with the LINK
command, as described on page 125. Example:
$ FORTRAN PXL_SET
HELP
- Invoke the online help facility. This command can take a specific command name as an option to display help on a particular topic. Typing HELP
alone will show you the list of topics on which more help is available, as described on page 10. Example:
$ HELP FORTRAN
LINK
- Link a compiled object file to create an executable image file. This step is required before a program can be run. Object files have a file type of .OBJ
and executable images have a file type of .EXE
. Example:
$ LINK PXL_SET
PASCAL
- Run the Pascal compiler on a program source file to create an object file. Pascal source files have a file type of .PAS
. Example:
$ PASCAL QUICKSORT
PRINT
- Print a file at the default printer, or at a printer specified by the /QUE=
qualifier. The PRINT
command has many other options, which are discussed in detail on page 59. Example:
$ PRINT MAIL.LIS
PURGE
- Delete all but the most current version of files in the current directory (see page 53). Example:
$ PURGE
RUN
- Execute the executable image of a program file (see page 125 for details). Executable images have a file type of .EXE
. Example:
$ RUN QUICKSORT
SET
- Define or change a file or device characteristic. Several parameters can be specified, some of which are listed in the following table:
Table 2.2: SET Parameters
SHOW
- Display information about a process, device, or the system. There are many parameters used by this command, some of which are described in the following table:
Table 2.3: SHOW Parameters
TYPE
- Display the contents of a file on the terminal screen. Example:
$ TYPE MSG.TXT
Line Editing and the Recall Buffer
Have you ever typed a 40 character command only to get an error message? The VMS operating system has a line editor that will let you recall and edit your last 20 commands. Figure 2.4 shows an example of the RECALL
command being used to list previous commands. The RECALL
command can recall all or any one of your 20 most recent commands. By pressing the up arrow you can also recall your previous command. The line editor has two modes: insert and overwrite. Pressing
-
will toggle between the modes. By using the arrow keys, you can move left and right along the command line. Table 2.4 lists other line editing commands that you can use.
Figure 2.4: Using the Recall Buffer
Table 2.4: Line Editing Commands
Control Operations and Flow
Different terminals behave in different ways, and you need to be familiar with your terminal. Some of the most important operations are generated by pressing the
key (on some terminals this key is marked
or the
) while simultaneously pressing another key. These are known as control operations, and they control the execution of your process on the system, or the flow of characters from the system to your terminal. Some control operations are echoed to the screen; these are identified by a caret (
^
).
key (marked as the
key on most keyboards, and occasionally marked as
on older terminals). This will delete the previously typed character. Do not press the
(or
) key for this purpose because the two keys operate differently.
(
) will cause the system to display a backslash character and the character deleted. When you press another key, another backslash will be printed enclosing the deleted character. If you press
-
the command line will be redisplayed correctly.
Table 2.5: Control Operations
Procedures
Any user can write and run a list of DCL commands; this is known as a procedure. A command procedure is executed using the @
character before the file name (which generally ends in a .COM
file type). A simple example of a command procedure is shown below.
$ START:
$ SHOW TIME
$ WAIT 00:00:30
$ GOTO START
This procedure will display the time every 30 seconds until you press
-
. If the procedure was stored in a file named
TIME.COM
, then it would be executed by typing the following command:
$ @TIME
Up to eight parameters (called P1
through P8
) can be defined in a command procedure. These parameters are then passed values when the procedure is invoked. For example, let's change the previous command procedure to use a parameter to define the length of time that should elapse before the system redisplays the time. The following example shows how this can be done.
$ START:
$ SHOW TIME
$ WAIT 'P1'
$ GOTO START
The new procedure would then be invoked using the following command to show the time every minute:
$ @TIME 00:01:00