Reputation: 1000
I'm using following bash alias on my dev computer :
alias lamp_perm="sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX $PWD && sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx $PWD"
It works well but only for the path I've opened my console : when changing dir, alias stays relative to start path.
I'd like that the alias change permissions for current path, how can I do that?
Thanks,
Ben.
Upvotes: 1
Views: 547
Reputation: 784998
Use a function instead of alias
:
unalias lamp_perm
lamp_perm () {
sudo setfacl -R -m u:www-data:rwX -m u:$(whoami):rwX $PWD &&
sudo setfacl -dR -m u:www-data:rwx -m u:$(whoami):rwx $PWD
}
Upvotes: 2