I've looked at a few similar threads, but I can't bridge from those examples to what I'm working on, so I'm hoping someone can help.
I want to extend the following statement
find $PathToCheck -type f \( -not -iwholename "$ScriptDir/*" \) -exec md5sum "{}" \;>$NewSigs
to exclude several directories that are below the directory I am searching.
When I used -name like in this post
w w w . unix.com / unix-dummies-questions-answers/16921-question-non-recursive-find-syntax.html
(had to put in spaces... forum wouldn't let me post otherwise)
I got
find: warning: Unix filenames usually don't contain slashes (though pathnames do). (etc.)
and the find didn't work.
The path that I am passing in the variable ($PathToCheck) looks like:
/home/username/
and the paths I want to exclude (also want to pass in variables) will look like
/home/username/public_html/somedirectory
/home/username/public_html/otherdirectory/etc/ignorethis
(There are many other directories under /home/username/public_html/ that I want to search - just in case that information makes a difference.)
I'm trying to write my script so I can easily configure multiple exclude directories in (a) shell variable(s), but as long as I know how to write the general form of the statement with 2 or 3 exclusions, I should be able to work the rest out.
Any help would be most appreciated.