483 lines
8.2 KiB
HTML
483 lines
8.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>EVMS Command Line Interpreter</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="EVMS User Guide"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Using the EVMS interfaces"
|
|
HREF="evmscmuse.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="EVMS Ncurses interface"
|
|
HREF="ncurses.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="The EVMS log file and error data collection"
|
|
HREF="debuglevels.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>EVMS User Guide</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="ncurses.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 2. Using the EVMS interfaces</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="debuglevels.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="COMMANDLINE"
|
|
></A
|
|
>2.3. EVMS Command Line Interpreter</H1
|
|
><P
|
|
>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.</P
|
|
><P
|
|
>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 save changes to disk.
|
|
When invoked, the EVMS CLI prompts for commands. </P
|
|
><P
|
|
>The volume management commands the EVMS CLI understands
|
|
are specified in the <TT
|
|
CLASS="filename"
|
|
>/usr/src/evms-2.2.0/engine2/ui/cli/grammar.ps</TT
|
|
>
|
|
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. </P
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="CLITASKS"
|
|
></A
|
|
>2.3.1. Using the EVMS CLI</H2
|
|
><P
|
|
>Use the <B
|
|
CLASS="command"
|
|
>evms</B
|
|
> command to start
|
|
the EVMS CLI. If you do not enter an option with
|
|
<B
|
|
CLASS="command"
|
|
>evms</B
|
|
>, 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 <TT
|
|
CLASS="userinput"
|
|
><B
|
|
>exit</B
|
|
></TT
|
|
>.
|
|
You can modify this behavior by using
|
|
the following options with <B
|
|
CLASS="command"
|
|
>evms</B
|
|
>:
|
|
|
|
<P
|
|
></P
|
|
><DIV
|
|
CLASS="variablelist"
|
|
><DL
|
|
><DT
|
|
>-b</DT
|
|
><DD
|
|
><P
|
|
>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 <B
|
|
CLASS="command"
|
|
>-f</B
|
|
> option.</P
|
|
></DD
|
|
><DT
|
|
>-c</DT
|
|
><DD
|
|
><P
|
|
>This option saves changes to disk
|
|
only when EVMS CLI exits, not after
|
|
each command.</P
|
|
></DD
|
|
><DT
|
|
>-f <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
></DT
|
|
><DD
|
|
><P
|
|
>This option tells the EVMS CLI to use
|
|
<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
> as the source of
|
|
commands. The EVMS CLI exits when it reaches the
|
|
end of
|
|
<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
>.
|
|
</P
|
|
></DD
|
|
><DT
|
|
>-p</DT
|
|
><DD
|
|
><P
|
|
>This option only parses commands; it does
|
|
not execute them.
|
|
When combined with the <B
|
|
CLASS="command"
|
|
>-f</B
|
|
> option, the
|
|
<B
|
|
CLASS="command"
|
|
>-p</B
|
|
> option detects syntax errors in
|
|
command files. </P
|
|
></DD
|
|
><DT
|
|
>-h</DT
|
|
><DD
|
|
><P
|
|
>This option displays help information
|
|
for options used with the <B
|
|
CLASS="command"
|
|
>evms</B
|
|
>
|
|
command.</P
|
|
></DD
|
|
><DT
|
|
>-rl</DT
|
|
><DD
|
|
><P
|
|
>This option tells the CLI that all remaining items on the
|
|
command line are replacement parameters for use with
|
|
EVMS commands. </P
|
|
><DIV
|
|
CLASS="note"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="note"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/note.gif"
|
|
HSPACE="5"
|
|
ALT="Note"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>NOTE</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>Replacement parameters are accessed in EVMS commands using the
|
|
<TT
|
|
CLASS="option"
|
|
>$(x)</TT
|
|
> notation, where <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>x</I
|
|
></TT
|
|
> 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. </P
|
|
><P
|
|
>An example would be:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>evms -c -f testcase -rl sda sdb</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> <TT
|
|
CLASS="option"
|
|
>sda</TT
|
|
> is the replacement for <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>parameter1</I
|
|
></TT
|
|
> and
|
|
<TT
|
|
CLASS="option"
|
|
>sdb</TT
|
|
> is the replacement for <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>parameter2</I
|
|
></TT
|
|
></P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
></P
|
|
><DIV
|
|
CLASS="note"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="note"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/note.gif"
|
|
HSPACE="5"
|
|
ALT="Note"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>NOTE</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>Information on less commonly used options is available
|
|
in the EVMS man page. </P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="NOTECOMMAND"
|
|
></A
|
|
>2.3.2. Notes on commands and command files</H2
|
|
><P
|
|
>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.</P
|
|
><P
|
|
>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:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>"This is a name containing ""embedded"" quote marks."</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>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.</P
|
|
><P
|
|
>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:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
>/* 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</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="ncurses.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="debuglevels.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>EVMS Ncurses interface</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="evmscmuse.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>The EVMS log file and error data collection</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |