dotfiles/.local/bin/scripts/own

10 lines
265 B
Text
Raw Normal View History

2023-04-06 16:21:36 +02:00
#!/bin/sh -e
# Recursively take ownership of the given files or the current directory
2023-04-06 16:21:36 +02:00
u=$USER
case "$1" in
(+*) sudo chmod -R "$1" "${@:-.}"; shift; break;;
(-*) u="${1#-}"; shift; break;;
esac
sudo chown -R --preserve-root "$u:$u" "${@:-.}"
2024-06-28 22:34:05 +03:00
#sudo chmod u+w . -R