are reasons why you should not parse ls if you can help it.
2. The following will not work:
done < ls /[direcotory name]
3. What were you intending for the pipe in this line:
file=$(echo -e "$file" |
4. As previous poster pointed out, where is the grep?
5. Along with file you could also do a man on test to see how you can get some classifications on what a device is
is a reference that may help you (if you don't already have one)