summaryrefslogtreecommitdiff
path: root/pdiff.in
diff options
context:
space:
mode:
Diffstat (limited to 'pdiff.in')
-rwxr-xr-xpdiff.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/pdiff.in b/pdiff.in
new file mode 100755
index 0000000..0483d2c
--- /dev/null
+++ b/pdiff.in
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# part of even-more-utils, version #VERSION#
+
+# diff with pipes
+
+if [ $# -lt 3 ]; then
+ >&2 echo 'usage:'
+ >&2 echo 'pdiff file1 file2 pipe_command [options to diff]'
+ exit 1
+fi
+
+file_one="$1";
+file_two="$2";
+pipe_cmd="$3";
+shift 3
+
+diff "$@" <(
+ cat "${file_one}" \
+ | bash -c "${pipe_cmd}"
+) <(
+ cat "${file_two}" \
+ | bash -c "${pipe_cmd}"
+)