1

I've got a nice PS1 prompt that I want to only be used when user 'gatty' uses su for root.

PS1='\[\e[32m\]#\[\e[37m\] '

When other users like 'george' etc login, I want them to get the standard PS1 instead of 'gattys'.

Is this possible, how would I go about doing this?

Thanks!

0

1 Answer 1

-1

In root's .bashrc, check the contents of /proc/self/loginuid, and set your custom PS1 variable only if it equals your UID.

1
  • Works perfect! Thank you :D
    – gatty
    Commented Sep 8, 2019 at 22:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .