Using The Functions For Generating Output - Oracle ZFS Storage Appliance Administration Manual

Hide thumbs Also See for ZFS Storage Appliance:
Table of Contents

Advertisement

Using the Choices Function
}
Here is the output of running the script:
2.
SHARE
pond:projectA/fs1
pond:projectA/fs2
pond:projectB/lun1
puddle:deptA/share1
puddle:deptB/share1
puddle:deptB/share2

Using the Functions for Generating Output

Reporting state on the system requires generating output. Scripts have several built-in functions
made available to them to generate output:
TABLE 10
Function
dump
print
printf
52
Oracle ZFS Storage Appliance Administration Guide, Release OS8.6.x • September 2016
set('pool', pools[p]);
projects = list();
for (i = 0; i < projects.length; i++) {
run('select ' + projects[i]);
shares = list();
for (j = 0; j < shares.length; j++) {
run('select ' + shares[j]);
share = pools[p] + ':' + projects[i] + '/' + shares[j];
printf(fmt, share, get('space_data'),
get('space_available'));
run('cd ..');
}
run('cd ..');
}
Built-in Functions for Generating Output
USED
AVAILABLE
31744
566196178944
31744
566196178944
21474836480
587670999040
238475
467539219283
129564
467539219283
19283747
467539219283
Description
Dumps the specified argument to the terminal, without
expanding embedded newlines. Objects will be displayed
in a JSON-like format. Useful for debugging.
Prints the specified object as a string, followed by a
newline. If the object does not have a toString method,
it will be printed opaquely.
Like C's printf(3C), prints the specified arguments
according to the specified formatting string.

Advertisement

Table of Contents
loading

Table of Contents