aboutsummaryrefslogtreecommitdiff
path: root/suser
blob: a9bca1f32d9f15f25d00f3c432b8c4992b5586b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash
#
# A shorthand for changing to a user
#

# Parameters
BASENAME="`basename $0`"
USER="$1"

# Check
if [ -z "$USER" ]; then
  echo "usage: $BASENAME <user>"
  exit 1
fi

# Go
sudo su $USER -s $SHELL