X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=list;h=6309b9c6e32c7f338c50dd82d6a2bbc1a6407a8d;hb=b51261aeeda1acc423146d627d9a0fc750ff44fd;hp=2c518e8fabe5d4d5e3a3eda0858a901f0a0168b9;hpb=9e4b0a7a58b3d7803c171eab2d146237b55521c0;p=khome.git diff --git a/list b/list index 2c518e8..6309b9c 100755 --- a/list +++ b/list @@ -1,15 +1,22 @@ #! /usr/bin/awk -f +BEGIN { + sep = sep ? sep : " " + end = end ? end : "" +} + ! /^\#/ && ! /^$/ { xs[$1]++ } END { + _sep = "" for (x in xs) { if (xs[x] > 1) { printf ">>> [WARNING] : '%s' was listed %d times.\n", x, xs[x] > "/dev/stderr" } - printf("%s%s", sep, x) - sep = " " + printf("%s%s", _sep, x) + _sep = sep } + printf "%s", end }