#!/usr/bin/env bash IFS=$'\n' array=($(find . -mindepth 1 -maxdepth 1 -type d)) unset IFS for item in "${array[@]}"; do echo "[ ${item} ]" done