Howard Chu wrote:(all as a single line of text)
Unfortunately the asort() function is a GNU extension, so I think we have to
pipe to the sort command instead:
grep -v '^#' | awk 'BEGIN{FS="\n";RS=""}{j=0; for (i=1; i<=NF; i++){ if ($i ~
/^ /) { x[j] = x[j] "\n" $i; } else { j++; x[j] = $i }} print x[1]; for (i=2;
i<=j; i++){print x[i] | "sort +0";} delete x; close("sort +0"); print ""}'
Oops. Except piping to sort loses the field boundaries, so continuation lines are messed up.
Ciao, Michael.