From owner-freebsd-questions Mon Aug 3 09:22:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA18825 for freebsd-questions-outgoing; Mon, 3 Aug 1998 09:22:46 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cyclone.degnet.baynet.de (www.degnet.baynet.de [194.95.214.129]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA18772 for ; Mon, 3 Aug 1998 09:22:27 -0700 (PDT) (envelope-from malte.lance@gmx.net) Received: from neuron.webmore.de (unverified [194.95.214.170]) by cyclone.degnet.baynet.de (EMWAC SMTPRS 0.83) with SMTP id ; Mon, 03 Aug 1998 18:23:31 +0200 Received: (from malte.lance@gmx.net) by neuron.webmore.de (8.8.8/8.8.8) id SAA04635; Mon, 3 Aug 1998 18:17:41 +0200 (CEST) From: Malte Lance MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 3 Aug 1998 18:17:41 +0200 (CEST) To: Sascha Schumann Cc: William Woods , "freebsd-questions@FreeBSD.ORG" Subject: Re: BASH prompt question In-Reply-To: References: X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <13765.57486.496079.524320@neuron.webmore.de> Reply-To: malte.lance@gmx.net Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sascha Schumann writes: > On Sun, 2 Aug 1998, William Woods wrote: > > > I would like to make my bash prompt show a little more info, like what dir the > > user is in. How would I do this? > > Edit /etc/profile and insert at the end: > > test "$SHELL" = "/bin/bash" && test -e ~/.bashrc && source ~/.bashrc > > Or, if that looks too ugly to you: > > if [ "$SHELL" = "/bin/bash" -a -e ~/.bashrc ] ; then > source ~/.bashrc > fi > > Then you can put all your personal stuff (in case your system is used by > more than one) in your ~/.bashrc: > > PS1='\u@\h:`pwd -P` $ ' > export PS1 Sorry to drop in. ~/.bash_profile and ~/.bashrc are sourced by bash itself when they exist. No need to source them via a system-rc. Further bash is in the ports-collection and when installing the bash as a port or package, it will be installed in /usr/local/bin by default. So all this guy has to do is to create and edit ~/.bashrc for non-login-shells and ~/.bash_profile for login-shells. Yes Sascha, your answer is absolutely correct just a little OS-specific ;) Little excerpt from "man bash": When bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/pro- file, 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. The --noprofile option may be used when the shell is started to inhibit this behavior. When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists. 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 Malte. > > For more info, see man bash ;) > > Greetings, > > Sascha > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message