Created
February 5, 2015 13:06
-
-
Save mariorez/fb2f97e1f9f25dba9177 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Execute command as user | |
function uexec { | |
if [ $# -eq 1 ]; then | |
eval "(su - '$1')" | |
fi | |
if [ $# -eq 2 ]; then | |
eval "(su - '$1' -c '${2}')" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment