aboutsummaryrefslogtreecommitdiff
path: root/chownme
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-03-30 09:30:12 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-03-30 09:30:12 -0300
commit97f993676f75a65f2cde0550c540aadc5998c745 (patch)
treef1adde9d86c62009c3221f707aa71f421c5979af /chownme
parent4ad83ae25822184f947c3b66a198fd03aa21ff31 (diff)
downloadscripts-97f993676f75a65f2cde0550c540aadc5998c745.tar.gz
scripts-97f993676f75a65f2cde0550c540aadc5998c745.tar.bz2
Adds chownme
Diffstat (limited to 'chownme')
-rwxr-xr-xchownme18
1 files changed, 18 insertions, 0 deletions
diff --git a/chownme b/chownme
new file mode 100755
index 0000000..d0a801d
--- /dev/null
+++ b/chownme
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Chown a destination to the current user.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+DEST="$*"
+ME="$(whoami)"
+
+# Check
+if [ -z "$1" ]; then
+ echo "usage: $BASENAME <dest>"
+ exit 1
+fi
+
+# Proceed
+chown -R $ME. $DEST