# print table header # fields space allocation: underline, Path, Name, status, desc, reset underline printf "\n\t%s%-20s| %-10s%-12s| %-20s%s\n", &colorParse('%u'), 'Path', 'Name', '', 'Description', &colorParse('%n'); # header with some color characters printf "\t%-20s| %-10s%-12s| %-20s\n", '', '', '', ''; # empty line under the header while (my($key, $val) = each(%{$shares})) { .... # extract $path, $name, $status, $desc # color constants should be assigned with separate space in printf (their space is deducted when we print) # fields space allocation: pathColor, path, pathReset, shareName, statusColor, status, statusReset, desc printf "\t%s%-20s%s| %-10s%s%-12s%s| %-20s\n", $pathColor, &truncateStr($path, 20), $pathReset, &truncateStr($name, 10), $statusColor, $status, $statusReset, &truncateStr($desc, 20) || ''; } #### Path | Name | Description ------------------------------------------------------------------ | | /exadmin | testing | lalala / | test | /test1 | test1 (inactive) | hello RED - Directory is not accessible