Difference between revisions of "CLI"

From VSI OpenVMS Wiki
Jump to: navigation, search
m
 
(2 intermediate revisions by one other user not shown)
Line 14: Line 14:
  
 
==Qualifier==
 
==Qualifier==
Qualifiers serve to change the behavior of the command verb. They are delimited with slashes (/) and (optional) spaces. Sometimes the qualifier position matters:
+
Qualifiers (similar to options in other OSs) serve to change the behavior of the command verb. They are delimited with slashes (/) and (optional) spaces. Sometimes the qualifier position matters:
  
 
* command qualifiers appear after the command verb or keywords and change the meaning of the entire command (<nowiki>PRINT/COPIES=3 FILE1,FILE2</nowiki> prints three copies of both files)
 
* command qualifiers appear after the command verb or keywords and change the meaning of the entire command (<nowiki>PRINT/COPIES=3 FILE1,FILE2</nowiki> prints three copies of both files)
Line 22: Line 22:
 
[[Symbol|Symbols]] are stored in the CLI symbol table. The size of this table is defined in the system parameter [[CLISYMTBL]]. In any process, CLI defines the following reserved symbols:
 
[[Symbol|Symbols]] are stored in the CLI symbol table. The size of this table is defined in the system parameter [[CLISYMTBL]]. In any process, CLI defines the following reserved symbols:
  
* $STATUS
+
* [[$STATUS]]
* $SEVERITY
+
* [[$SEVERITY]]
* $RESTART
+
* [[$RESTART]]
  
 
In a batch process, CLI defines symbols [[P1]] through [[P8]] that allow access to the batch job parameters.
 
In a batch process, CLI defines symbols [[P1]] through [[P8]] that allow access to the batch job parameters.
Line 36: Line 36:
  
 
* on the right side of an assignment statement (=)
 
* on the right side of an assignment statement (=)
* in an argument for a [[Lexical Function|lexical function]]
+
* in an argument for a [[Lexical functions|lexical function]]
 
* in a [[DEPOSIT]], [[EXAMINE]], or [[WRITE]] command
 
* in a [[DEPOSIT]], [[EXAMINE]], or [[WRITE]] command
 
* at the beginning of a command line when the string is not followed by an equal sign (=) or a colon (:)
 
* at the beginning of a command line when the string is not followed by an equal sign (=) or a colon (:)
Line 63: Line 63:
 
* [[SYS$ERROR]]
 
* [[SYS$ERROR]]
 
* [[SYS$COMMAND]]
 
* [[SYS$COMMAND]]
 +
 +
=Prompt=
 +
A prompt is a symbol that appears on the command line prompting the user to take action. The default prompt defined by DCL is "$". It can be changed with [[SET PROMPT]]; some commands that require user input (such as [[INQUIRE]] or [[READ SYS$COMMAND]]) allow you to set a different prompt for the duration of that command.
  
 
=Commands Executed Inside the CLI=
 
=Commands Executed Inside the CLI=

Latest revision as of 08:05, 2 December 2019

CLI, or Command Line Interpreter, is a piece of software responsible for parsing user input on the command line and taking the required action (such as invoking images). Even though OpenVMS provides a possibility of using multiple CLIs, only DCL CLI is supplied with OpenVMS.

Command Line Elements

After interpreting logical names and symbols, every word or symbol entered by the user on the command line is identified as one of the following elements:

Verb

Command verb is the first and the only indispensable element on the command line.

Keyword

Keywords accompany some command verbs with a very broad sense such as SET or SHOW and follow the command verb immediately delimited with a space.

Parameter

The purpose of parameters is to provide objects for the command verb to perform operations on (such as symbols, logical names, files and other objects). Parameters can appear anywhere on the command line after the command verb and keywords delimited with a space. Parameters in a list are delimited with a comma but no spaces.

Qualifier

Qualifiers (similar to options in other OSs) serve to change the behavior of the command verb. They are delimited with slashes (/) and (optional) spaces. Sometimes the qualifier position matters:

  • command qualifiers appear after the command verb or keywords and change the meaning of the entire command (PRINT/COPIES=3 FILE1,FILE2 prints three copies of both files)
  • positional qualifiers change the meaning of the command line element they follow (e.g. if they appear after a certain parameter they change the meaning (PRINT FILE1/COPIES=3,FILE2 prints three copies of FILE1 but one copy of FILE2)

CLI Symbols

Symbols are stored in the CLI symbol table. The size of this table is defined in the system parameter CLISYMTBL. In any process, CLI defines the following reserved symbols:

In a batch process, CLI defines symbols P1 through P8 that allow access to the batch job parameters.

Symbol Interpretation

Certain elements on the command line follow this order of interpretation by CLI:

local symbol - global symbol - DCL Tables - DCL$PATH

Here they are:

  • on the right side of an assignment statement (=)
  • in an argument for a lexical function
  • in a DEPOSIT, EXAMINE, or WRITE command
  • at the beginning of a command line when the string is not followed by an equal sign (=) or a colon (:)
  • in the brackets on the left side of an assignment statement when you are performing substring substitution or numeric overlays

In all other cases words appearing on the command line are treated as Command Line Elements: for example, any word appearing after TYPE that is not preceded by a slash to indicate that it is a qualifier is considered to be the parameter of a TYPE command, i.e. a file residing in the default directory (or a logical name that points to a file):

$ type my_symbol
%TYPE-W-SEARCHFAIL, error searching for DKA0:[TEST]MY_SYMBOL.LIS;
-RMS-E-FNF, file not found
 

To force symbol substitution on the command line, use single brackets:

$ type 'my_symbol'
This is a file.
 

Process Permanent Files

CLI initializes the following process permanent files and logical names for them:

Prompt

A prompt is a symbol that appears on the command line prompting the user to take action. The default prompt defined by DCL is "$". It can be changed with SET PROMPT; some commands that require user input (such as INQUIRE or READ SYS$COMMAND) allow you to set a different prompt for the duration of that command.

Commands Executed Inside the CLI

The following commands are executed inside the CLI, which means they do not invoke images:

See also