Last active
December 16, 2022 23:11
-
-
Save santiagon610/9de14abf10fe3c0d2b3643c10834c061 to your computer and use it in GitHub Desktop.
Colorful bash prompt - red when root
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
| #!/bin/bash | |
| # conditional bash prompt | |
| # if root provide a red and white shell prompt | |
| # if not root provide an orange and green shell prompt | |
| # | |
| # generated from ezprompt.net, nothing special :) | |
| if [ $UID == 0 ]; then | |
| PS1="\[\e[31m\]\u\[\e[m\]@\h \[\e[31m\]\w\[\e[m\] \\$ " | |
| else | |
| PS1="\[\e[33m\]\u\[\e[m\]@\[\e[32m\]\h\[\e[m\] \[\e[36m\]\w\[\e[m\] \\$ " | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment