aboutsummaryrefslogtreecommitdiff
path: root/mkshrc
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-09-11 21:54:38 -0400
committerMitch Riedstra <mitch@riedstra.us>2019-09-11 21:54:38 -0400
commit142c972879f1055c7aa4844609e437aa9dd36370 (patch)
treefc95bba4dc1f409f369507359c010f0226f9341d /mkshrc
parentfb8c67c4445dfd685a1a83aaf188dda6c0357b67 (diff)
downloaddotfiles-142c972879f1055c7aa4844609e437aa9dd36370.tar.gz
dotfiles-142c972879f1055c7aa4844609e437aa9dd36370.tar.xz
Fix up the setperms function
Diffstat (limited to 'mkshrc')
-rw-r--r--mkshrc9
1 files changed, 5 insertions, 4 deletions
diff --git a/mkshrc b/mkshrc
index ded03ee..dbfa177 100644
--- a/mkshrc
+++ b/mkshrc
@@ -327,10 +327,11 @@ syschroot() {
# Usage: dir_oct:file_oct path
setperms() {
- dir_perms=$(echo $1 | awk -F: '{print $1}')
- file_perms=$(echo $1 | awk -F: '{print $2}')
- find "$2" -type f -print0 | xargs -0 chmod "$file_perms"
- find "$2" -type d -print0 | xargs -0 chmod "$dir_perms"
+ _perm="$1"; shift
+ dir_perms=$(echo "$_perm" | awk -F: '{print $1}')
+ file_perms=$(echo "$_perm" | awk -F: '{print $2}')
+ find "$@" -type f -print0 | xargs -0 chmod "$file_perms"
+ find "$@" -type d -print0 | xargs -0 chmod "$dir_perms"
}
set_title() {