From 1770226be03cc644bfb1284754aca23db89f5a0b Mon Sep 17 00:00:00 2001 From: zegonix Date: Thu, 28 May 2026 16:32:41 +0200 Subject: [PATCH] (bash) handling arrays of paths --- bash-test.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bash-test.sh b/bash-test.sh index a4c051a..08d203c 100755 --- a/bash-test.sh +++ b/bash-test.sh @@ -1,11 +1,9 @@ #!/usr/bin/env bash -array=("test0" "test1" "test2") -suffix="henlo" +IFS=$'\n' +string=($(find . -maxdepth 1 -mindepth 1 -type d)) +unset IFS -echo "${array[@]}" -echo "" - -array=("${array[@]/%/${suffix}}") - -echo "${array[@]}" +for item in "${string[@]}"; do + echo "|${item}|" +done