3.3. EVMS Command Line Interpreter

The EVMS Command Line Interpreter (EVMS CLI) provides a command-driven user interface for EVMS. The EVMS CLI helps automate volume management tasks and provides an interactive mode in situations where the EVMS GUI is not available.

Because the EVMS CLI is an interpreter, it operates differently than command line utilities for the operating system. The options you specify on the EVMS CLI command line to invoke the EVMS CLI control how the EVMS CLI operates. For example, the command line options tell the CLI where to go for commands to interpret and how often the EVMS CLI must commit changes to disk. When invoked, the EVMS CLI prompts for commands.

The volume management commands the EVMS CLI understands are specified in the /usr/src/evms-1.9.0/engine2/ui/cli/grammar.ps file that accompanies the EVMS package. These commands are described in detail in the EVMS man page, and help on these commands is available from within the EVMS CLI.

3.3.1. Using the EVMS CLI

Use the evms command to start the EVMS CLI. If you do not enter an option with evms, the EVMS CLI starts in interactive mode. In interactive mode, the EVMS CLI prompts you for commands. The result of each command is immediately saved to disk. The EVMS CLI exits when you type exit. You can modify this behavior by using the following options with evms:

-b

This option indicates that you are running in batch mode and anytime there is a prompt for input from the user, the default value is accepted automatically. This is the default behavior with the -f option.

-c

This option commits changes to disk only when EVMS CLI exits, not after each command.

-f filename

This option tells the EVMS CLI to use filename as the source of commands. The EVMS CLI exits when it reaches the end of filename.

-p

This option only parses commands; it does not execute them. When combined with the -f option, the -p option detects syntax errors in command files.

-h

This option displays help information for options used with the evms command.

-rl

This option tells the CLI that all remaining items on the command line are replacement parameters for use with EVMS commands.

NoteNOTE
 

Replacement parameters are accessed in EVMS commands using the $(x) notation, where x is the number identifying which replacement parameter to use. Replacement parameters are assigned numbers (starting with 1) as they are encountered on the command line. Substitutions are not made within comments or quoted strings.

An example would be:

evms -c -f testcase -rl sda sdb

sda is the replacement for parameter1 and sdb is the replacement for parameter2

NoteNOTE
 

Information on less commonly used options is available in the EVMS man page.

3.3.2. Notes on commands and command files

The EVMS CLI allows multiple commands to be displayed on a command line. When you specify multiple commands on a single command line, separate the commands with a colon ( : ). This is important for command files because the EVMS CLI sees a command file as a single long command line. The EVMS CLI has no concept of lines in the file and ignores spaces. These features allow a command in a command file to span several lines and use whatever indentation or margins that are convenient. The only requirement is that the command separator (the colon) be present between commands.

The EVMS CLI ignores spaces unless they occur within quote marks. Place in quotation marks a name that contains spaces or other non-printable or control characters. If the name contains a quotation mark as part of the name, the quotation mark must be "doubled," as shown in the following example:

"This is a name containing ""embedded"" quote marks."

EVMS CLI keywords are not case sensitive, but EVMS names are case sensitive. Sizes can be input in any units with a unit label, such as KB, MB, GB, or TB.

Finally, C programming language style comments are supported by the EVMS CLI. Comments can begin and end anywhere except within a quoted string, as shown in the following example:

/* This is a comment */
Create:Vo/*This is a silly place for a comment, but it is
allowed.*/lume,"lvm/Sample Container/My LVM
Volume",compatibility