From owner-freebsd-questions@FreeBSD.ORG Fri Apr 25 00:47:54 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D40691CA for ; Fri, 25 Apr 2014 00:47:54 +0000 (UTC) Received: from relay.mailchannels.net (ar-005-i201.relay.mailchannels.net [162.253.144.83]) by mx1.freebsd.org (Postfix) with ESMTP id 39365152F for ; Fri, 25 Apr 2014 00:47:53 +0000 (UTC) X-Sender-Id: _forwarded-from|107.201.34.133 Received: from mail-24.name-services.com (ip-10-204-11-22.us-west-2.compute.internal [10.204.11.22]) by relay.mailchannels.net (Postfix) with ESMTPA id 9C6641005CF; Fri, 25 Apr 2014 00:47:51 +0000 (UTC) X-Sender-Id: _forwarded-from|107.201.34.133 Received: from mail-24.name-services.com (mail-24.name-services.com [10.248.1.153]) (using TLSv1 with cipher AES128-SHA) by 0.0.0.0:2500 (trex/5.1.2); Fri, 25 Apr 2014 00:47:51 GMT X-MC-Relay: Forwarding X-MailChannels-SenderId: _forwarded-from%7C107.201.34.133 X-MailChannels-Auth-Id: demandmedia Received: from [10.0.10.1] (107-201-34-133.lightspeed.bcvloh.sbcglobal.net [107.201.34.133]) by mail-24.name-services.com with SMTP; Thu, 24 Apr 2014 17:47:45 -0700 Message-ID: <5359B0B0.6060802@a1poweruser.com> Date: Thu, 24 Apr 2014 20:47:44 -0400 From: Fbsd8 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Polytropon Subject: Re: 10.0 set prompt for new users has problems References: <5359293C.20501@a1poweruser.com> <20140424200058.6c4c6cc8.freebsd@edvax.de> In-Reply-To: <20140424200058.6c4c6cc8.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 00:47:55 -0000 Polytropon wrote: > On Thu, 24 Apr 2014 11:09:48 -0400, Fbsd8 wrote: >> 10.0 host and using pw command to adduser. >> pw adduser test -c Test-user -m -g wheel -w yes >> >> original /etc/csh.cshrc and /usr/share/skel/dot.cshrc files >> >> When I log into user test the prompt is a single dollar sign. > > This is not the default prompt for the C shell. It > looks like you're running sh or bash. Can you check? > Try > > $ echo $SHELL > > to see what login shell has been defined. Maybe the pw > command did not set csh as the login shell, and you're > left with sh as default. > All the users I created with the above pw command are sh shell. Used vipw and see that the last field at end of the line is /bin/sh > > >> Issuing the ll command i see .cshrc* >> Why does this file end with an *? > > This is because the file has the executable attribute (+x) > set. There are other "signifiers" for files and directories. > Try the following > > % setenv LSCOLORS 'ExGxdxdxCxDxDxBxBxegeg' > % ls -laFG .cshrc > > The colors will also reflect the "executable" attribute. > > Note that this file does _not_ have to be executable, so > check /usr/share/skel if the file has _accidentally_ been > chmod'ed with +x. When copying the content of the skel/ > directory (or subtree), attributes will be kept. > > This must be the new default in 10.0 because ls -laFG /usr/share/skel shows dot.cshrc* and ls -la /usr/share/skel shows dot.cshrc > >> I can edit the as .cshrc* or .cshrc and replace the existing set prompt >> statement with set prompt = "# %/ >" then save the file, exit and login >> again. The prompt is still a dollar sign. > > The user's .cshrc file should override any other settings > dome at "higher levels" such as /etc/csh.cshrc. Try the > following: > > set promptchars = "%#" > set prompt = "%n@%m:%~%# " > > This should give you the default C shell prompt. If _this_ > works, start modifying it according to your preference. > You can replace %n with %N on newer C shell versions. > > > >> If I issue set prompt = "# %/ >" command from the test user command line >> the prompt still doe's not change. > > Very strange - I have tested this here, it changes the prompt. > > poly@r56:~% set prompt = "# %/ >" > # /home/poly >_ > > However, when I try this in sh: > > poly@r56:~% sh > $ set prompt = "# %/ >" > $ _ > > This encourages me to think that my initial assumption of > you running the "wrong" shell is correct. :-) > > > >> I can edit the /usr/share/skel/dot.cshrc replacing the existing set >> prompt with the new one, deluser test, adduser test, and still get >> dollar sign for the prompt even though I see the wanted prompt statement >> in user test home directory .cshrc* file. > > Add -s csh to your pw adduser command. > pw adduser test -c Test-user -m -g wheel -s csh -w yes Fixed the problem. Now the changes made to /usr/share/skel/dot.cshrc take affect in the users added using that pw command. The aliases also work now. > > >> Another problem is the alias commands la and lf don't work but the ll >> alias does work. > > Try "which ls ll" to find out what is actually being executed. > > Example from my (customized) C shell: > > % which ls ll > ls: aliased to ls -FG -D "%Y-%m-%d %H:%M:%S" > ll: aliased to ls -laFG -D "%Y-%m-%d %H:%M:%S" > > Note that I've modified /etc/csh.cshrc to make global settings > for all users (prompt, aliases, $LSCOLORS) and almost emptied > the /usr/share/skel/dot.cshrc template. Users here are free to > add their own settings and replace default things, but most > of them are happy. The unhappy ones use bash anyway. :-) > >