__acl: avoid duplication and safer sed for last occurence replacement

This commit is contained in:
ander 2019-04-16 23:28:30 +03:00
parent 8b3c84dfef
commit 7924c1339c
1 changed files with 4 additions and 2 deletions

View File

@ -41,10 +41,12 @@ do
then
if [ "$is_dir" = '1' ]
then
acl="$( echo "$acl" | sed 's/X$/x/' )"
rep=x
else
acl="$( echo "$acl" | sed 's/X$/-/' )"
rep=-
fi
acl="$( echo "$acl" | sed -r "s/(.*)X/\1$rep/" )"
fi
if echo "$parameter" | grep -Eq '(mask|other)'