Handling whitespace in For loop
Hi there
I'm trying to write a script that will list all files and directoryfrom a directory.
LIST=$(ls $DIRNAME)
for file in $DIRNAME; do
echo $file
done.
Unfortunately the for loop does not handle whitespaces in files.
Is there a solution to it?
Is there a system variable that define the field separator of a for loop?
Thank you.
|