From owner-freebsd-questions Wed Jan 2 8:30:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id C7F0837B417 for ; Wed, 2 Jan 2002 08:30:29 -0800 (PST) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Wed, 2 Jan 2002 16:30:20 +0000 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 16LoGO-0005wh-00; Wed, 02 Jan 2002 16:29:12 +0000 Date: Wed, 2 Jan 2002 16:29:12 +0000 (GMT) From: Jan Grant X-X-Sender: To: Erik Trulsson Cc: Julio Merino , freebsd-questions Subject: Re: Some /bin/sh questions In-Reply-To: <20020102162401.GA35605@student.uu.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 2 Jan 2002, Erik Trulsson wrote: > On Wed, Jan 02, 2002 at 05:11:48PM +0100, Julio Merino wrote: > > On Wed, Jan 02, 2002 at 05:04:45PM +0100, Oliver Fromme wrote: > > > Julio Merino wrote: > > > > First, how can I add the current working directory in the PS1? > > > > > > export PATH=$PATH:. > > > > > > However, you should be aware of the security implications. > > > It's usually better not to do that. > > > > No, no, no... PS1, not PATH. I know that about PATH, and I don't want > > it. What I would like is sh to show the current working directory in > > the prompt line... So, I do this in zsh: > > export PS1="%w%# " > > And I get this as my command prompt: > > /tmp# > > > > Is this possible with sh? > > I don't think you can do that with /bin/sh $ moo () { > chdir $1 > PS1=`pwd` export PS1 > } $ alias cd=moo There may be better ways, but what you say next is accurate... > In general, sh is not very good for interactive use. For interactice > use I would suggest you use tcsh (included in the base system) or bash > or zsh (both available from the ports system) instead. -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk That which does not kill us goes straight to our thighs. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message