Even in a context with static children, it can be useful to iterate over those children programmatically. This can be done by using the children function, which returns an array of static children.
configuration services script var svcs = children(); for (var i = 0; i < svcs.length; ++i) { run(svcs[i]); try { printf("%-10s %s\n", svcs[i], get('<status>')); } catch (err) { } run("done"); }
% ssh root@koi < space.aksh Password: cifs disabled dns online ftp disabled http disabled identity online idmap online ipmp online iscsi online ldap disabled ndmp online nfs online nis online ntp online scrk online sftp disabled smtp online snmp disabled ssh online tags online vscan disabled