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