Created
July 6, 2014 13:04
-
-
Save skihero/3ef54a7a152720fd391a to your computer and use it in GitHub Desktop.
without whoami
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
# Set up PATH depending on whether we're root or a normal user. | |
# There's no real reason to exclude sbin paths from the normal user, | |
# but it can make tab-completion easier when they aren't in the | |
# user's PATH to pollute the executable namespace. | |
# | |
# It is intentional in the following line to use || instead of -o. | |
# This way the evaluation can be short-circuited and calling whoami is | |
# avoided. | |
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}" | |
else | |
PATH="/usr/local/bin:/usr/bin:/bin:${PATH}" | |
fi | |
export PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment