(bash) handling arrays of paths

This commit is contained in:
zegonix authored and scbj committed 2026-05-29 09:37:06 +02:00
1 parent 5cc74596cc
commit 607543767b
1 file changed
+6 -8
+6 -8
View File
@@ -1,11 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
array=("test0" "test1" "test2") IFS=$'\n'
suffix="henlo" array=($(find . -mindepth 1 -maxdepth 1 -type d))
unset IFS
echo "${array[@]}" for item in "${array[@]}"; do
echo "" echo "[ ${item} ]"
done
array=("${array[@]/%/${suffix}}")
echo "${array[@]}"