From owner-freebsd-questions@FreeBSD.ORG Sat Jan 18 07:41:59 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 006B1B84 for ; Sat, 18 Jan 2014 07:41:58 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B03151976 for ; Sat, 18 Jan 2014 07:41:58 +0000 (UTC) Received: from r56.edvax.de (port-92-195-149-155.dynamic.qsc.de [92.195.149.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id D742B3CE7A; Sat, 18 Jan 2014 08:41:55 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s0I7fUgA005054; Sat, 18 Jan 2014 08:41:30 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 18 Jan 2014 08:41:30 +0100 From: Polytropon To: Fbsd8 Subject: Re: set prompt for new users Message-Id: <20140118084130.a9b78380.freebsd@edvax.de> In-Reply-To: <52DA24A4.8010804@a1poweruser.com> References: <52D87D89.1060606@a1poweruser.com> <20140117183438.21f60837.freebsd@edvax.de> <52DA24A4.8010804@a1poweruser.com> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jan 2014 07:41:59 -0000 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, ...