Go to main content

Oracle® ZFS Storage Appliance Administration Guide, Release OS8.7.x

Exit Print View

Updated: September 2017
 
 

Understanding the Built-in CLI Functions

Of course, scripts are of little utility unless they can interact with the system at large. There are several built-in functions that allow your scripts to interact with the system:

Table 9  Built-in Functions to Support System Interactions
Function
Description
get
Gets the value of the specified property. Note that this function returns the value in native form, e.g. dates are returned as Date objects.
list
Returns an array of tokens corresponding to the dynamic children of the current context.
run
Runs the specified command in the shell, returning any output as a string. Note that if the output contains multiple lines, the returned string will contain embedded newlines.
props
Returns an array of the property names for the current node.
set
Takes two string arguments, setting the specified property to the specified value.
choices
Returns an array of the valid property values for any property for which the set of values is known and enumerable.