From c4b63c5de63eca928a5dd29225840afd75298db7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 16:39:35 +0200 Subject: [PATCH 1/3] eval --- sh/main.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 75b1815..94908be 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -192,10 +192,13 @@ _rwx_code_variables="" rwx_parse_code() { # parse aliases - local line + local line text RWX_ALIASES="$(rwx_parse_aliases)" while IFS= read -r line; do - eval "${line/ = /() { } \"\${@}\"; }" + text="s| = |() { |" + text="$(echo "${line}" | sed "${text}")" + text="${text} \"\${@}\"; }" + eval "${text}" done < Date: Sun, 6 Jul 2025 16:41:01 +0200 Subject: [PATCH 2/3] eval/shrink --- sh/main.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 94908be..66751c7 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -196,9 +196,7 @@ rwx_parse_code() { RWX_ALIASES="$(rwx_parse_aliases)" while IFS= read -r line; do text="s| = |() { |" - text="$(echo "${line}" | sed "${text}")" - text="${text} \"\${@}\"; }" - eval "${text}" + eval "$(echo "${line}" | sed "${text}") \"\${@}\"; }" done < Date: Sun, 6 Jul 2025 16:42:12 +0200 Subject: [PATCH 3/3] eval/oneline --- sh/main.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 66751c7..0abfb5e 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -195,8 +195,7 @@ rwx_parse_code() { local line text RWX_ALIASES="$(rwx_parse_aliases)" while IFS= read -r line; do - text="s| = |() { |" - eval "$(echo "${line}" | sed "${text}") \"\${@}\"; }" + eval "$(echo "${line}" | sed "s| = |() { |") \"\${@}\"; }" done <