summaryrefslogtreecommitdiffstats
path: root/dirsu
blob: 2dc7d0b1236881c0da2a7f2dfeee7b8dc0f85f2a (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"
exec su "$user" -c "cd $PWD; exec bash"