Cli termination codes, Examples of the batch file for the cflset command, Example of a cli termination code reference – HP XP P9500 Storage User Manual
Page 12

The following table lists file and directory names that you can change. If you make a change in
the If... column, then you must make the corresponding change that is listed in the You must change...
column.
You must change...
If...
The .txt file in each CLI command file to the file name
that you specified.
You rename the user authentication file name...
This directory location in each file to the relative or absolute
path. You can only specify single-byte characters for path
or file names.
You move the directory where you store the user
authentication file to a directory other than “/CFLCLITool”...
The #! /bin/csh directory name in the first row in each
file to your installation directory. For example, /usr/bin/
csh
).
(For UNIX) You install a shell program in a directory other
than "/bin"...
Examples of the batch file for the CFLSET command
The following table lists examples of the batch file for the CFLSET command.
Batch file
Operating system
java -jar -Djava.security.policy=java.policy JSanCLI.jar
myAuthentication.txt CFLSET %1 %2
Windows
#! /bin/cshjava -jar -Djava.security.policy=java.policy
JSanCLI.jar myAuthentication.txt CFLSET $1 $2
UNIX
CLI termination codes
When the system processes a command, the system writes a CLI termination code. Even when the
termination codes appear correct, check for errors in the spreadsheet.
The following table lists the CLI termination codes that the system returns when you execute a CLI
command (batch file).
Meaning
Code
Command completed successfully.
0
An error occurred.
Other than 0
You can use a CLI termination code reference in your batch file that causes a message to appear
at the command prompt. The following table lists CLI termination code references that you can use.
Termination code reference
Batch file or Shell script
%errorlevel%
Windows batch file
%?
UNIX Bourne shell script
%Status
UNIX C shell script
Example of a CLI termination code reference
This example shows a reference to a CLI termination code that you can use in a Windows batch
file. When you run the batch file and the system returns a CLI termination code of 0, the
“COMMAND SUCCESSFUL” message appears. If the system receives a CLI termination code other
than 0, the “COMMAND FAILED” message appears.
java -Djava.security.policy=java.policy -jar JSanCLI.jar
myAuthentication.txt CFLGET %1 %2if %errorlevel% NEQ 0 echo COMMAND FAILED.if %errorlevel% EQU 0 echo COMMAND
SUCCESSFUL.
12
Command Line Interface Installation and Commands