정적 자식 항목이 있는 컨텍스트에서도 이러한 자식 항목을 프로그래밍적으로 반복하면 유용할 수 있습니다. 이렇게 하려면 정적 자식 항목 배열을 반환하는 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