aboutsummaryrefslogtreecommitdiff
path: root/bin/ddup.awk
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-07-02 17:36:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-07-02 22:57:07 +1200
commit95276f25769a0607cda50041169197d0522b98ff (patch)
tree3a4738901390c94f76de6ee7b6394d39b4c1ed00 /bin/ddup.awk
parentCoerce seed to number (diff)
downloaddotfiles-95276f25769a0607cda50041169197d0522b98ff.tar.gz
dotfiles-95276f25769a0607cda50041169197d0522b98ff.zip
Lots of cleanup of awk scripts
Mostly inspired by suggestions from gawk --lint
Diffstat (limited to 'bin/ddup.awk')
-rw-r--r--bin/ddup.awk6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/ddup.awk b/bin/ddup.awk
index 2dec1d00..63381cfb 100644
--- a/bin/ddup.awk
+++ b/bin/ddup.awk
@@ -1,2 +1,6 @@
# Skip duplicate lines (without requiring sorted input)
-!seen[$0]++
+$0 in seen { next }
+length($0) {
+ seen[$0] = 1
+ print
+}