Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jan 2002 16:29:12 +0000 (GMT)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        Julio Merino <juli@klamath.local>, freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Some /bin/sh questions
Message-ID:  <Pine.GSO.4.31.0201021627510.9788-100000@mail.ilrt.bris.ac.uk>
In-Reply-To: <20020102162401.GA35605@student.uu.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <juli@klamath.local> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.31.0201021627510.9788-100000>