Created
November 28, 2014 20:17
-
-
Save icook/eddbc202bef79b6563f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Easy alias for switching to perform actions as another | |
# user, even if they have no login shell | |
as_other() { | |
pushd `eval echo ~$1` | |
sudo -H -u $1 -s /bin/bash | |
popd | |
} | |
alias as=as_other |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment