if it's shell scripting:
two ways I will present onto thee, the number of the ways being two:
the first way, of the two ways being this: that thou commenteth out thy lines like so:
Code:
/tmp/directory1
#/tmp/directory2
/home
grep -v "^#"
The second way you can also see, and is not as efficient, but sometimes schoolteachers like things a bit complicated:
make a file of directories to ignore:
in your loop for the directories, you can grep the directory-to-be-cleared in the ignore file (send stdout and stderr to /dev/null); use the return value of grep (checkout man grep) to determine whether or not the directory is in the ignore-list; if it isn't: clear it out, else keep it dirty.
the rest I leave to you, as I have a sinking feeling some school told people to look here for help