summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wührer <def@gmx.at>2023-05-13 18:02:41 +0200
committerDavid Wührer <def@gmx.at>2023-05-13 18:02:41 +0200
commit044b08d127cef08545f831a0c4960d450680679b (patch)
tree6baf9e8ef213137dacfba6ebb7169cbdb3720a4a
parent9bd7b1078f0d23bd452110451d1762f118e99fbf (diff)
improve reduce
-rwxr-xr-xreduce4
1 files changed, 2 insertions, 2 deletions
diff --git a/reduce b/reduce
index 2e7269c..b9b69fe 100755
--- a/reduce
+++ b/reduce
@@ -1,9 +1,9 @@
#!/bin/bash
fn=$1
-f() { eval "$fn $*"; }
+f() { eval "$fn" "$@"; }
a=$2
b=$3
shift 3
[[ -z "$b" ]] && exec echo "$a"
-exec "$0" "$fn" "$(f "$a" "$b")" "$@"
+exec "$0" "$fn" "$(f "$a" "$b")" "${@@Q}"