I require the script to cd to a directory, then delete all but a few files in sub-directories—but leave the folders alone. Would it help to use switch
cd
switch
Using find? You can use several parameters, including depth, file age (as in stat), perms etc...
find . -maxdepth 2