summaryrefslogtreecommitdiff
path: root/bin/reduce
diff options
context:
space:
mode:
Diffstat (limited to 'bin/reduce')
-rwxr-xr-xbin/reduce9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/reduce b/bin/reduce
new file mode 100755
index 0000000..b9b69fe
--- /dev/null
+++ b/bin/reduce
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+fn=$1
+f() { eval "$fn" "$@"; }
+a=$2
+b=$3
+shift 3
+[[ -z "$b" ]] && exec echo "$a"
+exec "$0" "$fn" "$(f "$a" "$b")" "${@@Q}"