summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-09-27 01:00:57 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-09-27 01:00:57 +0200
commit7cb10e40473705ccf838aee8918f77cdc59080f5 (patch)
tree83099bf3b19da490079daf9501582d071a514b60
parentea3c2837b880e624d698c1c7687f227eb4da1078 (diff)
downloadscripts-7cb10e40473705ccf838aee8918f77cdc59080f5.tar.gz
xxd-a: xxd -a, but for more duplicates
mtime: 19 July 2013
-rwxr-xr-xxxd-a3
1 files changed, 3 insertions, 0 deletions
diff --git a/xxd-a b/xxd-a
new file mode 100755
index 0000000..c22f1cf
--- /dev/null
+++ b/xxd-a
@@ -0,0 +1,3 @@
+#!/bin/sh
+# `xxd -a`, but besides 00s, it also folds other duplicates
+xxd "$@" | awk -F: '{if(prev==$2){if(p)print "*";p=0}else {print;p=1;}}{prev=$2}'