Command aliases
This topic discusses command aliasing.
With aliasing, you define a name for the alias followed by a value that is the name of a command and any options associated with command. The aliased command string is replaced by the defined value and the entire line is reparsed. Passwords used in aliased commands must first be encrypted using the encrypt command.
Aliased commands are saved in the command configuration file. The default configuration file is c:\program files\ibm\tpc\cli\libs\tpccli.conf.
For example, to shorten a frequently used command, you can define the following alias:
tpctool>lsperf = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url 9.44.33.126:8990 -fabric -perf
After the alias is defined, you can run the lsperf command to run the aliased lsdev command previously displayed.
You can provide a short form command targeting different device servers, as follows:
tpctool>lsperfd1 = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostOne:9161 -perf
tpctool>lsperfd2 = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostTwo:9161 -perf
You can specify additional options and arguments for an aliased command:
tpctool>lsperfd2 -fabric -ctype port
The command is expanded as follows:
tpctool>lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostTwo:9161 -perf -fabric -ctype port
You can also nest aliases:
tpctool>lsperf = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostTwo:9161 -perf -fabric
tpctool>lsperfd1 = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostOne:9161
tpctool>lsperfd2 = lsdev -user dsadmin -pwd 1ac75d82784ce0a327d45289604ae7b227
-url hostTwo:9161
To unset an alias, type the name of the command alias followed by the '=' sign:
lsperf =