Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2014 18:34:38 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Fbsd8 <fbsd8@a1poweruser.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: set prompt for new users
Message-ID:  <20140117183438.21f60837.freebsd@edvax.de>
In-Reply-To: <52D87D89.1060606@a1poweruser.com>
References:  <52D87D89.1060606@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140117183438.21f60837.freebsd>