problems using ls with for_in (SH)

Sdävtaker sdavtaker at
Thu Nov 8 19:17:59 PST 2007

Im trying to get a file with all the md5 hashes of one directory.
My initial script was this:
for file in $(ls)
        echo $file
        md5 $file

The problem is with the file names who contains "whitespaces" becouse 
the for_in passed each word as one iteration and not the full filename, 
I'd tried using -B in ls, but doesnt help.
Any idea what can i do?

More information about the freebsd-questions mailing list