beautypg.com

Return code – Avago Technologies 3ware SAS 9750-4i User Manual

Page 149

background image

Return Code

www.lsi.com/channel/products

141

4

If this is the first time you are creating the environment variable and you
want to disable command logging, add the variable TW_CLI_LOG and
specify the value as OFF. (Command logging is on by default.)

5

If the environment variable already exists, you may enable or disable it by
editing the value and changing it to ON or OFF, as desired.

6

Restart your system for the new environment variable setting to take
effect.

Return Code

While informative messages are written to standard output, error messages are
written to standard error. On success, 0 is returned. On failure, 1 is returned.

To view the return code for Linux:

At the shell command prompt type:

echo $?

The screen prints either a 0 or a 1, depending on whether the command was
successful or not.

For example, if you had a 3ware controller with an ID of 0, you could type
this command:

tw_cli /c0 show

(c0 information displayed here)

echo $?

0

If you type:

tw_cli /c7 show

error: (CLI003) specified controller does not exist.

echo $?

1

This example fails (returns 1) because there is no controller 7.

To view the return code for Windows, in a command window type

tw_cli /c0 show

(c0 info displayed here)

if errorlevel 0 echo 0

0

tw_cli /c7 show

error....

if errorlevel 1 echo 1

1

This example fails (returns 1) because there is no controller 7.