The savestat utility enables you to store and retrieve up to 20 values to persistent storage. The utility is designed to identify where you left off in an installation script even when a system reboot is required. This utility is designed to return values that set the ? environment variable so that you can branch in a script (.sh) file based on the result of the utility's execution.

The savestat utility uses the persistent storage capability of the ASU command. Therefore, for the script to work, the following files must be available:


The savestat utility that comes with the Scripting Toolkit uses the following command-line syntax:
SAVESTAT [/q] -set1=value [...-set2=value ... -set21=value]
SAVESTAT [/q] -getn
SAVESTAT [/q] -validate
SAVESTAT [/q] -signature
Parameter Description Usage
Saves an integer value, value, to the nth location in persistent-storage memory, where n is an integer from 1-21.
Return codes:
  • 0 if successful
  • 1 if not successful
./ -setn=value
  • n is an integer from 121
  • value is an integer from 0254
Retrieves a value currently set in the nth location in persistent-storage memory.
Return codes:
  • The value stored at the location specified by n, if successful.
  • 255 if not successful.
./ -getn

Where n is the location of a previously-stored value.

Verifies that the persistent storage contains the savestat signature.
Return codes:
  • 0 if storage contains the signature
  • 1 if storage does not contain the signature
./ -signature
Verifies that the system is supported by savestat.
Return codes:
  • 0 if the system is supported
  • 1 if the system is not supported
./ -validate
Invokes the quiet mode, which suppresses prompts. This parameter is optional and can be used with any other savestat parameter.
./ -q -set1=100
Note: The help for indicates that the reset parameter is supported. does not currently support the reset parameter. To reset all of the storage locations to zero, use the set command as shown here: --set1=0 --set2=0 --set3=0 --set4=0 --set5=0 --set6=0 --set7=0
--set8=0 --set9=0 --set10=0 --set11=0 --set12=0 --set13=0 --set14=0
--set15=0 --set16=0 --set17=0 --set18=0 --set19=0 --set20=0 --set21=0


The following examples illustrate how to use the savestat utility.
Example Description
./ -set2=100
Stores the value 100 in the second persistent-storage memory location.
./ -get2

if  [ $? eq 100 ]; then
  echo The value 100 was found successfully.
  echo The value 100 was not found.
Retrieves the value of the second persistent-storage memory location and branches in the script file according to the value returned.