The
-path and
-prune stuff in post #2 works fine - if -path would be supported.
Note that for testing you must
-print in the last
-o branch; the implicit print does
\( ... \) -print i.e. prints in all branches.
For the Solaris
find I suggest to
grep first.
Code:
#!/bin/sh
dirs=`
cd /
ls | fgrep -vx "\
proc
system"
`
(
cd /
# word-split on \n only
IFS=
# do not glob-match
set -f
find $dirs -type f -exec digest -a md5 {} \; > /all_files_md5sum.txt
)
The ( ) enforce a sub shell, so the
IFS= and
set -f and
cd / do not impact a following main shell code.
(Also the ` ` is a sub shell, so its
cd / won't impact the main shell.)