(bash) handling arrays of paths

This commit is contained in:
zegonix
2026-05-28 16:32:41 +02:00
parent 5cc74596cc
commit 1770226be0
+6 -8
View File
@@ -1,11 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
array=("test0" "test1" "test2") IFS=$'\n'
suffix="henlo" string=($(find . -maxdepth 1 -mindepth 1 -type d))
unset IFS
echo "${array[@]}" for item in "${string[@]}"; do
echo "" echo "|${item}|"
done
array=("${array[@]/%/${suffix}}")
echo "${array[@]}"