Re: prompt w/ uid 0 for cshrc

From: Eitan Adler <lists_at_eitanadler.com>
Date: Mon, 19 Nov 2012 20:36:13 -0500
On 18 November 2012 18:32, Eitan Adler <lists_at_eitanadler.com> wrote:
> Hey,
>
> at the moment the current default csh prompt looks like
>
> user_at_hostname:directory% command
>
> This leads to an unexpected[*] result when using su (without "-").
>
> In particular the user part is *not* changed to "root" (or "toor" or
> any other superuser indication) although the promptchar is changed to
> "#".
> This causes some confusion for new users and even some experienced ones.
>
> I worked around this issue by including the following
>
>         if ($uid == 0) then
>                 set user = root
>         endif
>
> which I'm not certain is a good idea.
>
> I would like to replace this with logic like
>
> if $uid = 0 AND $user != toor AND $user != root
>   set user = "+$user"
> endif
>
> does anyone think this is a bad idea? can anyone propose a better
> idea? Is the status quo okay?
...

I was pointed in the right direction. I should use %N instead of %n.



-- 
Eitan Adler
Received on Tue Nov 20 2012 - 00:36:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:32 UTC