From 15689cb0fe9019e17c6b9a017e7e5bb132cb76b4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 4 Jul 2025 07:50:19 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=88=92ifs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/tmux.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sh/tmux.sh b/sh/tmux.sh index 1577751..1301204 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -25,13 +25,10 @@ rwx_tmux_server() { } rwx_tmux_servers() { local active=\"\$(rwx_tmux_server)\" - local ifs=\"\${IFS}\" local name path text local paths=\"\$(lsof -U | awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\" - IFS=\" -\" - for path in \${paths}; do + while IFS= read -r path; do name=\"\$(basename \"\${path}\")\" text=\"\${text}\\ #[fg=default]\\ @@ -47,8 +44,9 @@ rwx_tmux_servers() { #[bg=##282828]\${name}\\ #[bg=##181818] \\ \" - done - IFS=\"\${ifs}\" + done < Date: Fri, 4 Jul 2025 07:56:32 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E2=88=92ifs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/lint/shellcheck.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sh/lint/shellcheck.sh b/sh/lint/shellcheck.sh index 0cbe758..0253062 100644 --- a/sh/lint/shellcheck.sh +++ b/sh/lint/shellcheck.sh @@ -3,10 +3,12 @@ rwx_shellcheck() { local file module modules path file="$(mktemp)" modules="$(rwx_find_shell "${root}")" - printf "%s\n" "${modules}" | while IFS= read -r module; do + while IFS= read -r module; do path="${root}/${module}" echo ". \"${path}\"" >>"${file}" - done + done < Date: Fri, 4 Jul 2025 07:58:06 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=E2=88=92ifs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/self.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sh/self.sh b/sh/self.sh index dfbe203..4118d64 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -5,7 +5,7 @@ rwx_doc() { local name="${1}" [ -n "${name}" ] || return local constant doc func line module - printf "%s\n" "${RWX_CODE}" | while IFS= read -r line; do + while IFS= read -r line; do case "${line}" in "#!"*) doc="" ;; "#↓"*) @@ -44,7 +44,9 @@ rwx_doc() { fi ;; esac - done + done < Date: Fri, 4 Jul 2025 08:13:29 +0200 Subject: [PATCH 4/4] uniq --- sh/main.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 8e76ad4..321d1dc 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -63,8 +63,6 @@ rwx_main() { # │ main │ cache │ # ╰──────┴───────╯ -RWX_CODE="" - # cache source code of a module rwx_cache() { local root="${1}" @@ -73,6 +71,7 @@ rwx_cache() { local path="${root}/${module}" local text text="$(cat "${path}")" + # all source code RWX_CODE="${RWX_CODE}\ #↓ ${name} ${text}