*BSD News Article 67188


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!metro!metro!asstdc.scgt.oz.au!nsw.news.telstra.net!act.news.telstra.net!vic.news.telstra.net!news.mira.net.au!inquo!in-news.erinet.com!en.com!uunet!in1.uu.net!news.vader.org!news.demon.co.uk!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@awfulhak.demon.co.uk (Brian Somers)
Newsgroups: comp.unix.bsd.misc
Subject: Re: Help!  How do I set my prompt?
Date: 29 Apr 1996 11:49:52 +0100
Organization: Coverform Ltd.
Lines: 33
Message-ID: <4m26sg$gc@anorak.coverform.lan>
References: <317E4568.62C0@cyclesak.com> <4lqbrf$c7k@innocence.interface-business.de>
X-NNTP-Posting-Host: awfulhak.demon.co.uk
X-Newsreader: TIN [version 1.2 PL2]

J Wunsch (j@ida.interface-business.de) wrote:
: "Tokewanna Inc." <sales@cyclesak.com> writes:
: >I'm using csh shell and I was wondering what the set command is so
: >it will show my directory locations.  Thanks!

: ``set prompt'', but you knew this. :-)

: The standard csh doesn't provide a good means to arrange for a prompt
: displaying the cwd.  You can only do this by overriding the `cd',
: `pushd', and `popd' builtins by something that uses the `chdir'
: builtin, and sets the prompt internal variable.  Alas, pushd and popd
: are rather complex to implement.

Ah, but you don't need to re-implement anything.....

alias cd='\'cd\' \!^; set prompt=`pwd`'
alias pushd='pushd \!^; set prompt=`pwd`'
alias popd='popd \!^; set prompt=`pwd`'

:-)

: Modern shells (tcsh, bash) allow for a much more sophisticated prompt
: string, so your wishes should easily be accomplished there.  For
: example, all my xterms display the $cwd in their window title.

: -- 
: J"org Wunsch					       Unix support engineer
: joerg_wunsch@interface-business.de       http://www.interface-business.de/~j


--
Brian <brian@awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour....