Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. # If id command returns zero, you’ve root access.
  2. if [ $(id -u) -eq 0 ];
  3. then # you are root, set red colour prompt
  4. PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]"
  5. else # normal
  6. PS1="[\\u@\\h:\\w] $"
  7. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement