The poolcfg command with the –f option can take input from a text file that contains poolcfg subcommand arguments to the –c option. This method is appropriate when you want a set of operations to be performed. When processing multiple commands, the configuration is only updated if all of the commands succeed. For large or complex configurations, this technique can be more useful than per-subcommand invocations.
Note that in command files, the # character acts as a comment mark for the rest of the line.
$ cat > poolcmds.txt create system tester create pset pset_batch (uint pset.min = 2; uint pset.max = 10) create pool pool_batch associate pool pool_batch (pset pset_batch)
# /usr/sbin/poolcfg -f poolcmds.txt