On 08/08/18 22:34, Michał Górny wrote [excerpted]:
> +# Example:
> +# @CODE
> +# if path_exists "${ROOT}"/etc/foo.d/*.conf; then
> +#   do_something
> +# fi
> +# @CODE
>  path_exists() {
> -     local opt=$1
> -     [[ ${opt} == -[ao] ]] && shift || opt="-a"
> -
> -     # no paths -> return false
> -     # same behavior as: [[ -e "" ]]
> -     [[ $# -eq 0 ]] && return 1
> -
> -     local p r=0
> -     for p in "$@" ; do
> -             [[ -e ${p} ]]
> -             : $(( r += $? ))
> +     local p
> +     for p; do
> +             [[ -e ${p} ]] && return 0
>       done
You seem to have lost the inclusion of the function parameters in the
execution code - was this intentional?!
Regards,
Michael.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to