diff --git a/.gitignore b/.gitignore index b6384a2..9db9d0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ */archive/* +/ssh/config/_config diff --git a/shell.lib b/archive/shell.lib similarity index 100% rename from shell.lib rename to archive/shell.lib diff --git a/modules/utility/source.func b/archive/source.func.off similarity index 100% rename from modules/utility/source.func rename to archive/source.func.off diff --git a/function/ssh b/function/ssh index 6c87616..0b9e7fe 100644 --- a/function/ssh +++ b/function/ssh @@ -58,7 +58,7 @@ build_file "/etc/ssh/ssh_config" $OUTPUT for CDIR in "${CDIRS[@]}" do # FILES=$(find -n '*.cfg' -d 0 $CDIR) - for f in $(find -n '*.cfg' -p 'archive off' -d 0 $CDIR) ; + for f in $(_find -n '*.cfg' -p 'archive off' -d 0 $CDIR) ; do # echo "Processing $f"; [[ $f ]] && build_file "$f" $OUTPUT diff --git a/modules/utility/file.lib b/modules/utility/file.lib index 7a40625..be7c0f0 100644 --- a/modules/utility/file.lib +++ b/modules/utility/file.lib @@ -71,7 +71,7 @@ case "$OPTION" in n) # NAMES=("$OPTARG") IFS=',' read -r -a NAMES <<< "${OPTARG}" - # echo INCLUDING ONLY THESE FILE NAMES ${NAMES[*]} + # NAMES=$OPTARG ;; d) DEPTH=$OPTARG @@ -128,6 +128,8 @@ fi # echo paths ${PATHS[@]} >&2 # echo exclude names ${ENAMES[@]} >&2 +set -o noglob + if [[ ${PATHS[0]} ]]; then for path in ${PATHS[@]}; do # echo excluding $path @@ -137,22 +139,32 @@ fi if [[ ${ENAMES[0]} ]]; then for name in ${ENAMES[@]}; do - # echo excluding name $name - FIND+=$(echo ' ! -name "'${name}'"') + debug excluding name "$name" + FIND+=$(echo ' ! -name '$name'') done fi +debug "INCLUDING ONLY THESE FILE NAMES ${NAMES[*]}" if [[ ${NAMES[0]} ]]; then - for name in ${NAMES[@]}; do - # echo only finding $name - FIND+=$(echo " -name ${name}") + for name in "${NAMES[@]}"; do + debug only finding $name + FIND+=$(echo " -name '${name}'") done fi +# if [[ $NAMES ]]; then +# debug names for find command $NAMES +# for name in $NAMES; do +# debug "xxonly finding '$name'" +# FIND+=$(set -o noglob;echo " -name '${name}'") +# done +# fi + + # echo # echo find dir: $DIR >&2 debug "find command: $FIND" - +set +o noglob local FILES FILES=$(eval $FIND | sort) [[ $FILES ]] && echo $FILES