Using the DS CLI interactive command mode (history and reports)

Use the DS CLI interactive command mode when you must process multiple transactions that cannot be incorporated into a script. The interactive command mode provides a history function that makes repeating or checking prior command usage easy to do.

About this task

In addition to being able to enter DS CLI commands at the DS CLI command prompt, a history function provides a view of the last DS CLI commands that you have used. It also allows you to repeat any of the last commands more quickly than having to type out the entire command. The example at the end of this process shows how the history function works.

The Windows platform allows the user to retrieve prior commands by using the up arrow, but this is a feature of the Windows platform and is not built into the DS CLI. While other platforms might not allow the up arrow feature, all of the supported platforms have the history function described here.

Note: Many of the DS CLI commands have a feature that allows you to specify a dash (-) for the parameter and the specified value is read from standard input. However, you cannot use the dash (-) while in the DS CLI interactive command mode.

Complete the following steps to use the DS CLI in the interactive command mode:

Procedure

  1. Log on to the DS CLI at the directory where it is installed.
  2. Provide the information that is requested by the information prompts. The information prompts might not appear if you have provided this information in your profile file. The command prompt switches to a dscli command prompt.
  3. Begin using the DS CLI commands and parameters. You are not required to begin each command with dscli because this prefix is provided by the dscli command prompt.
    Tip: Issue the setenv command to control how the reports that are generated by the ls commands are displayed on your computer. The setenv command allows you to set or display command output format options. For example, you can specify that the reports be displayed in one of the following formats:
    delim
    Displays output in a table format and sets the column delimiter to a single character.
    xml
    Displays output in XML format.
    stanza
    Displays output in stanza (vertical table) format.

    See the setenv command for more details.

Example

To use the DS CLI history function that is associated with the interactive command mode, complete the following steps:
  1. Issue an exclamation mark (!) to display CLI commands that you have used in the current session. For example: dscli> ! results in a list of commands such as the following example:

    [4] lsarraysite -dev IBM.2107-1300771
    [3] lsarray -dev IBM.2107-1300771
    [2] lsextpool -dev IBM.2107-1300771
    [1] lsextpool -dev IBM.2107-1300771

  2. Issue dscli> !1 to reissue the last command. Or, issue dscli> !3 to reissue command [3].