2023-04-06 14:21:36 +00:00
|
|
|
#!/bin/sh -e
|
2021-12-05 19:48:46 +00:00
|
|
|
# Recursively take ownership of the given files or the current directory
|
2023-04-06 14:21:36 +00:00
|
|
|
u=$USER
|
|
|
|
case "$1" in
|
|
|
|
(+*) sudo chmod -R "$1" "${@:-.}"; shift; break;;
|
|
|
|
(-*) u="${1#-}"; shift; break;;
|
|
|
|
esac
|
|
|
|
sudo chown -R --preserve-root "$u:$u" "${@:-.}"
|