head 1.2; access; symbols SHTOOL_1_0_0:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.2 date 99.04.29.11.21.06; author rse; state dead; branches; next 1.1; 1.1 date 99.04.29.11.19.34; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.04.29.11.19.34; author rse; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @#!/bin/sh ## ## ppl -- Pretty print a colon-sperarated list by avoiding tr and fmt ## Copyright (c) 1998-1999 Ralf S. Engelschall ## Originally written for the Apache configuration mechanism ## Usage: ppl ## list=` IFS=: for entry in $*; do if [ "x$entry" != "x" ]; then echo $entry fi done |\ sort |\ awk ' BEGIN { list = ""; n = 0; } { list = list $1; n = n + 1; if (n == 1 || n == 2) { list = list ":"; } if (n == 3) { list = list "\n"; n = 0; } } END { print list; } '` IFS=' ' for entry in $list; do echo $entry |\ awk -F: ' { printf("%-15s %-15s %-15s\n", $1, $2, $3); } ' done |\ awk '{ if (length($0) > 48) { printf("%s\n", substr($0, 0, 47)); } else { print $0; } }' |\ sed -e 's/^/ [/' -e 's/$/]/' @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import of shtool 1.0.0 @ text @@