set prompt for new users

Polytropon freebsd at edvax.de
Fri Jan 17 17:35:12 UTC 2014


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, inteded 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).


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list