diff --git a/bash-test.sh b/bash-test.sh index a4c051a..0c196a8 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' +array=($(find . -mindepth 1 -maxdepth 1 -type d)) +unset IFS -echo "${array[@]}" -echo "" - -array=("${array[@]/%/${suffix}}") - -echo "${array[@]}" +for item in "${array[@]}"; do + echo "[ ${item} ]" +done