set prompt for new users

Fbsd8 fbsd8 at a1poweruser.com
Sat Jan 18 06:59:43 UTC 2014


Polytropon wrote:
> On Fri, 17 Jan 2014 08:47:05 +0800, Fbsd8 wrote:
>> What file do I place my new 'set prompt' command in so all newly created 
>> users get it?
>>
>> I'm running 9.2 and 10.RC4
> 
> I assume you're talking about the C-Shell. There are two ways:
> 
> To make settings available for all users, set them centrally.
> This is /etc/csh.cshrc.
> 
> But also make sure the system settings are not getting overridden
> by user settings in ~/.cshrc. When a user is created, he will get
> the file /usr/share/skel/dot.cshrc as ~/.cshrc, so you can use
> that file as a template for new users.
> 
> Both files mentioned have a section that is tested for interactive
> shells. Here you can make your settings, for example to get the
> standard traditional full prompt:
> 
> 	if ($?prompt) then
> 		set promptchars = "%#"
> 		set prompt = "%n@%m:%~%# "
> 		set autolist
> 		# ... more stuff ...
> 	endif
> 
> You can of course add more settings to those files, intended for
> interactive and non-interactive shells (for example to set some
> environmental variables, even though there is a more elegant way
> to do things like that).
> 
> 

I use pw adduser command to add new users to the host. From the prompt I 
get when logging on to a new user I see the prompt format used in 
/usr/share/skel/dot.cshrc.

How is /etc/csh.cshrc used to set prompt for all users?




More information about the freebsd-questions mailing list