| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getFilesList { |
| |
| |
| local ARGSS='' |
| |
| |
| local ARGSL='pattern:,mindepth:,maxdepth:,type:,uid:' |
| |
| |
| |
| local ARGUMENTS='' |
| |
| |
| local PATTERN="$FLAG_FILTER" |
| |
| |
| local OPTIONS='' |
| |
| |
| cli_parseArgumentsReDef "$@" |
| |
| |
| cli_parseArguments |
| |
| |
| eval set -- "$ARGUMENTS" |
| |
| while true;do |
| case "$1" in |
| |
| --pattern ) |
| PATTERN="$2" |
| shift 2 |
| ;; |
| |
| --maxdepth ) |
| OPTIONS="$OPTIONS -maxdepth $2" |
| shift 2 |
| ;; |
| |
| --mindepth ) |
| OPTIONS="$OPTIONS -mindepth $2" |
| shift 2 |
| ;; |
| |
| --type ) |
| OPTIONS="$OPTIONS -type $2" |
| shift 2 |
| ;; |
| |
| --uid ) |
| OPTIONS="$OPTIONS -uid $2" |
| shift 2 |
| ;; |
| |
| -- ) |
| shift 1 |
| break |
| ;; |
| esac |
| done |
| |
| |
| |
| |
| |
| local LOCATIONS="$@" |
| |
| |
| cli_checkFiles ${LOCATIONS} |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| PATTERN="^.*(/)?${PATTERN}$" |
| |
| |
| |
| |
| |
| local FILES=$(find ${LOCATIONS} -regextype posix-egrep ${OPTIONS} -regex "${PATTERN}" | sort | uniq) |
| |
| |
| if [[ $? -eq 0 ]];then |
| echo "$FILES" |
| fi |
| |
| } |