i'm trying to read the contents of a directory into an array, but i'm not sure how to deal with subdirectories that have spaces.
the code i've got is like this:
if the subdirectory has a space, the text after the space will become a new array position. i know strings can handle having spaces, but i'm not sure how to do this correctly. any advice?
the code i've got is like this:
Code:
for dir in `ls /vmstorage/`
do
list[count]=$dir
echo "$count: $dir"
count=$((count+1))
done
if the subdirectory has a space, the text after the space will become a new array position. i know strings can handle having spaces, but i'm not sure how to do this correctly. any advice?