beautypg.com

Command validation, Other functionality, Combining commands – Dell Acceleration Appliances for Databases User Manual

Page 17: Creating aliases, Customizing the cli environment

background image

Command Validation

When command validation is enabled, a variety of preconditions are tested on the commands you
execute. Any failure of a precondition prints a descriptive message to the console, and the command is
not executed.

To check whether validation is on, run

shell:validate --get

To toggle validation, run

shell:set validate on

(or

off

)

Here’s what a validation error might look like:

pool:create newpool bogus_drive Error executing command:

Can’t create pool over bogus_drive, which doesn’t exist

OTHER FUNCTIONALITY

Combining Commands

You can combine multiple commands into a single one by using a semicolon to separate each
command. For example,

drives;volumes

will list all the drives and then list all the volumes.

Creating Aliases

You can create a short alias that will run a longer command. The

{ }

syntax is used to form a

closure (a first-class function that can be invoked). When a variable is assigned a closure as its
value, typing the name of the variable at the command line executes the closure.

The following example creates an alias named

vc

that runs the

volumes -dt –-cluster

command:

vc={volumes -dt --cluster}

To use aliases in later CLI sessions, you must save the CLI environment tree (

shell:save

).

Customizing the CLI Environment

The

shell:set

command has a wide variety of options that can be used to customize the way

the CLI operates. For example,

CONFIRMATION

prompts the user before command execution;

SUPPRESS_EXECUTION

parses and validates commands but suppresses their execution;

TIME_SAFT

displays the execution times for CLI commands; etc.

For more information on the

shell:set

command, see

Appendix A: Shell Commands for

Scripting

. For more examples that help you customize your CLI environment, see

Working with

the CLI Environment (Tree)

in Appendix B: Common CLI Tasks.

17