Skip to content

Instantly share code, notes, and snippets.

@gMagicScott
Created September 30, 2014 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gMagicScott/1edf8534a408fbf40607 to your computer and use it in GitHub Desktop.
Save gMagicScott/1edf8534a408fbf40607 to your computer and use it in GitHub Desktop.
Sudo aware bash prompt
LOGNAME=$(logname)
UUSER=$([ "${LOGNAME}" = "${USER}" ] && echo ${USER} || echo '$(tput setaf 1)${LOGNAME}$(tput sgr0) as ${USER}')
PS1="[${UUSER}@\h \W]\\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment