From owner-freebsd-questions Wed Mar 29 14:25:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.hellasnet.gr (mail.hellasnet.gr [212.54.192.3]) by hub.freebsd.org (Postfix) with ESMTP id 6BD8D37BE34 for ; Wed, 29 Mar 2000 14:25:32 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (ppp4.patr.hellasnet.gr [212.54.197.19]) by mail.hellasnet.gr (8.9.1/8.9.1) with ESMTP id AAA10764; Thu, 30 Mar 2000 00:24:24 +0200 (GMT) Received: (from charon@localhost) by hades.hell.gr (8.9.3/8.9.3) id RAA11933; Wed, 29 Mar 2000 17:09:26 +0300 (EEST) (envelope-from charon) Date: Wed, 29 Mar 2000 17:09:25 +0300 From: Giorgos Keramidas To: Vodyanoi Cc: FreeBSD Mail List -- Houston , FreeBSD-Questions Subject: Re: Prompt and Path questions Message-ID: <20000329170925.C10131@hades.hell.gr> Reply-To: keramida@ceid.upatras.gr References: <200003290559.AA228787102@mail.ev1.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200003290559.AA228787102@mail.ev1.net>; from hawk76@mail.ev1.net on Wed, Mar 29, 2000 at 05:59:35AM -0600 X-PGP-Fingerprint: 62 45 D1 C9 26 F9 95 06 D6 21 2A C8 8C 16 C0 8E Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Mar 29, 2000 at 05:59:35AM -0600, Vodyanoi wrote: > > I appear to have a small issue with the setup of both my path and > prompt settings. I am using sh for my shell. I have edited the > prompt setting in the .shrc file in the home dir but it didn't work > quite the way I expected it to. Please change your mailer settings to wrap text at 70 characters or so. It looks rather funny when an entire paragraph's text scrolls away in one single line. > PS1="`whoami`@`hostname | sed 's/\..*//'`" > case `id -u` in > 0) PS1="${PS1}|`pwd`# ";; > *) PS1="${PS1}|`pwd`$ ";; > esac This sets the prompt only once. To have PS1 updated each time you change your working directory, you can do one of two things: a) Install bash from the ports (shells/bash1 or shells/bash2), and set your PS1 in .bashrc with: export PS1='\u@\h|\w\$ ' b) Make `cd' a shell function, that calls `chdir' to do the actual change of the path, and updates PS1 with `pwd` again. Something like: cd () { chdir "$@"; PS1="$USER$`hostname | cut -d. -f1`|`pwd`$ "; export PS1; } of course, this is an ugly cludge, since if you use `chdir' instead of `cd', your PS1 will not be updated :/ - Giorgos Keramidas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message