summaryrefslogtreecommitdiffstats
path: root/dirsu
diff options
context:
space:
mode:
Diffstat (limited to 'dirsu')
-rwxr-xr-xdirsu10
1 files changed, 10 insertions, 0 deletions
diff --git a/dirsu b/dirsu
new file mode 100755
index 0000000..08d29d6
--- /dev/null
+++ b/dirsu
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+if [[ -z $1 ]]; then
+ target="$PWD"
+else
+ target="$1"
+fi
+user="$(stat -c %U "$target")"
+cd "$target"
+su "$user" -c "cd $PWD; bash"