summaryrefslogtreecommitdiff
path: root/pdiff.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-03-29 08:53:34 +0200
committerErich Eckner <git@eckner.net>2021-03-29 08:53:34 +0200
commit522c8cb129904ec9d5098a880fcc1d2bc942b846 (patch)
tree0517b430101fd4ea8676e54caf6acf343e9992b7 /pdiff.in
downloadeven-more-utils-522c8cb129904ec9d5098a880fcc1d2bc942b846.tar.xz
initial commit: make-permanently, pdiff, screen-rv0.0
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}"
+)