set prompt for new users
Polytropon
freebsd at edvax.de
Sat Jan 18 07:41:59 UTC 2014
On Sat, 18 Jan 2014 14:52:20 +0800, Fbsd8 wrote:
> 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?
By precedence. :-)
In order to have all (new) users benefit from what's been
configured globally in /etc/csh.cshrc, make sure their
~/.cshrc is empty (or at least does not override $prompt).
The easiest way to make sure is to empty the template for
this file in /usr/share/skel/dot.cshrc. Local files have
precedence over global files.
In your /etc/csh.cshrc, just modify the part for the
interactive shells like this:
if ($?prompt) then
set promptchars = "%#"
set prompt = "%n@%m:%~%# "
set autolist
# ... more stuff ...
endif
For a typical Linux bash-like prompt, use something like this:
set promptchars = '$#'
set prompt = "[%n@%m] %~ %# "
The C shell also has support for bold print and colors.
The codes are listed in the manpage.
Note that you can also use /etc/csh.login and /etc/csh.logout
to globally set the actions at login and logout time for
users with interactive shells. Their respective local files,
~/.login and ~/.logout, should be empty to allow this
mechanism.
See the "FILES" section in "man csh" for details.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list