diff --git a/.config/bash/module/own.sh b/.config/bash/module/own.sh index 903e27b..6029a11 100644 --- a/.config/bash/module/own.sh +++ b/.config/bash/module/own.sh @@ -2,12 +2,13 @@ # Root user by default. This directory recursively by default. # Usage: own [USER] [FILES] function own() { - local file="${2}" + local IFS=$'\n' + local files=("${@:2}") local user="${1}" # default to current dir. - if [ "${file}" = "" ]; then - file='.' + if [ "${files[*]}" = "" ]; then + files=(".") fi # default to current user. @@ -15,9 +16,11 @@ function own() { user="${UID}" fi - # set ownership. - chown "${user}":"${user}" -R "${file}" &> /dev/null + for file in "${files[@]}"; do + # set ownership. + chown "${user}":"${user}" -R "${file}" &> /dev/null - # remove access from group and others. - chmod -077 -R "${file}" + # remove access from group and others. + chmod -077 -R "${file}" + done }