From owner-freebsd-questions@FreeBSD.ORG Thu Sep 27 05:22:31 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C468010656D1 for ; Thu, 27 Sep 2012 05:22:31 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 8413B8FC14 for ; Thu, 27 Sep 2012 05:22:31 +0000 (UTC) Received: from r56.edvax.de (port-92-195-214-70.dynamic.qsc.de [92.195.214.70]) by mx01.qsc.de (Postfix) with ESMTP id 4953A3D068; Thu, 27 Sep 2012 07:22:28 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q8R5MRTo004236; Thu, 27 Sep 2012 07:22:27 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 27 Sep 2012 07:22:27 +0200 From: Polytropon To: freebsd@dreamchaser.org Message-Id: <20120927072227.9f57fff0.freebsd@edvax.de> In-Reply-To: <5063DF4B.1060904@dreamchaser.org> References: <5063DF4B.1060904@dreamchaser.org> 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 Mailing List Subject: Re: trouble getting .shrc to take X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 05:22:31 -0000 On Wed, 26 Sep 2012 23:08:27 -0600, Gary Aitken wrote: > Having set my shell to either sh or bash, > I can't seem to get .shrc to take. > If I have a .shrc that looks like: > > PROMPT_DIRTRIM=3; export PROMPT_DIRTRIM > PS1=\\w$ ; export PS1 > > PS1 is not defined when I log in, and the prompt is set to the default instead. > > If I do > ./.shrc > nothing seems to change; > although executing the above commands from the shell itself works. > > What am I missing? As far as I see from "man sh", the system's shell does not support PROMPT_DIRTRIM, so it's a bash feature. According to "man bash", its initialisation file is called ~/.bashrc. For example, if I put export PS1="\u@\h:\w\$ " into ~/.bashrc and execute bash, I get a standard prompt. So it should only be a matter of the correct file name. Note that bash has several files it can process at startup time, such as .bash_login, .profile and .bashrc. Their order is described in the manual, e. g. When bash is invoked as an interactive login shell, or as a non-inter- active shell with the --login option, it first reads and executes com- mands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc. You can find more information in the "INVOCATION" section of the manual at "man bash". There are files for per-user configuration as well as system-wide files. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...