summaryrefslogtreecommitdiff
path: root/chardiff.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
commit896161c483ceef3ed16e2f19a5c05106bed04512 (patch)
tree8e79f92d7b3dfe09fa97f4ae5feb8331ad6fbb52 /chardiff.sh
I can't believe I didn't have this in git before.
Diffstat (limited to 'chardiff.sh')
-rw-r--r--chardiff.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/chardiff.sh b/chardiff.sh
new file mode 100644
index 0000000..b6d7403
--- /dev/null
+++ b/chardiff.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+file1=${1?usage: chardiff FILE1 FILE2 [FLAGS]}
+file2=${2?usage: chardiff FILE1 FILE2 [FLAGS]}
+shift 2
+
+tmp1=`mktemp`
+chardiff_pre < "$file1" > "$tmp1"
+
+tmp2=`mktemp`
+chardiff_pre < "$file2" > "$tmp2"
+
+wdiff $@ "$tmp1" "$tmp2" | chardiff_post
+rm "$tmp1" "$tmp2"
+