home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22a8baf
)
Support custom separator and ending strings
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 13 Oct 2021 19:47:27 +0000
(15:47 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 13 Oct 2021 19:47:27 +0000
(15:47 -0400)
list
patch
|
blob
|
blame
|
history
diff --git
a/list
b/list
index
2c518e8
..
6309b9c
100755
(executable)
--- 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
}
This page took
0.035866 seconds
and
4
git commands to generate.