Find /Dir

Here is the problem i now have.

i have a list of directories like this

W9888
W9848
W9752
W9748
W9683
W9680
W9674
W9558
W9366

i need to scan through those directories and bring back a similar list, except only of the directories not containing subdirectories called "ebooks" or "e*" I had some help with this earlier and resolved all other issues i was having except for this one.

the list i get back could really only be one line less, but i am doing this over thousands of files.

here is what i have tried so far but it does not work.

find ./$line -maxdepth 1 -type d \! -name "e*" > noebook.txt

i'm running leopard

#!/bin/ksh
while read dir
do
     set -A arr  $(find $dir -type d -name 'e*' )
     if [[ ${#arr} -eq 0 ]] ; then
             echo $dir
     fi
done < dirfile > newdirfile

is there anyway to do this in bash. simply using it as is doesn't seem to work and i need to apend it to the end of an already working script.

Thanks

Does the subdirectory exist directly under the directory you are examining, or could it be nested arbitrarily deeply?

#!/bin/sh

find whatever you are already finding |
while read dir; do
  find $dir -type d -name 'e*' | grep . && continue
  echo "$dir"
done

I have done it! Thankyou era and Jim Mcnamara. Your help is appreciated. :slight_smile: