summaryrefslogtreecommitdiffstats
path: root/dirsu
blob: 08d29d630d393496a7f42f87b9dead4df82b3157 (plain)
1
2
3
4
5
6
7
8
9
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"