for path in ${CONFIG_PROTECT} ; do
path="${ROOT}${path}"
- find_opts="-iname ._cfg????_*"
+ # Do not traverse hidden directories such as .svn or .git.
+ find_opts="-name .* -type d -prune -o -name ._cfg????_*"
if [ ! -d "${path}" ]; then
[ ! -f "${path}" ] && continue
my_basename="${path##*/}"
path="${path%/*}"
- find_opts="-maxdepth 1 -iname ._cfg????_${my_basename}"
+ find_opts="-maxdepth 1 -name ._cfg????_${my_basename}"
fi
ofile=""
# The below set -f turns off file name globbing in the ${find_opts} expansion.
- for file in $(set -f; find ${path}/ ${find_opts} ! -iname '.*~' ! -iname '.*.bak' |
+ for file in $(set -f ; find ${path}/ ${find_opts} \
+ ! -name '.*~' ! -iname '.*.bak' -print |
sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do