Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: danpop@mail.cern.ch (Dan Pop)
Subject: Re: Directory Prompt
Date: 1996/05/07	[thread overview]
Message-ID: <danpop.831482768@news.cern.ch> (raw)
In-Reply-To: 4mnec0$r34@glitnir.ifi.uio.no


In <4mnec0$r34@glitnir.ifi.uio.no> torstenk@ifi.uio.no (Torsten Robert Kirschner) writes:

>>>>>> "TMW" == Timothy M Wieman <timw@isac.hces.com> writes:
>In article <1996May6.165118.16175@isac.hces.com> timw@isac.hces.com (Timothy M. Wieman) writes:
>TMW> Martin Hannigan (hannigan@shore.net) wrote:
>>> In article <4lt1oa$294@random.tpgi.com.au>,
>>> dhinkle <dhinkle@tpgi.com.au> wrote:
>>> >Does anyone know how to make the c shell display the current directory
>>> >in the prompt, and change the prompt as you change directories.
>
>>> I think you have to use 'bash' to be able to accomplish that.
>
>TMW> Sorry I don't know about csh, but you don't have to have 'bash';
>TMW> ksh, tcsh, and I'm sure others support it.
>
>Tim is right. Just put this in your ~/.cshrc file:
>
>set myhost=`expr $HOST : '\([^.]*\).*'`
>alias setprompt 'set prompt="$myhost `dirs` > "'
                                       ^^^^
Why dirs and not pwd?  Do you really want a list of directories in the
prompt?  Or do you never use pushd? (in which case, dirs is better, indeed)

>alias cd 'chdir \!* && setprompt'

How about pushd and popd?

>setprompt
>
>Should work for all csh-like shells. (I'm using tcsh.)

If you use tcsh it makes no sense to bother with aliases.  Simply use
the tcsh %c feature to put the path in your prompt.  It has the 
advantage that you can control how much of the path you put into your
prompt (a full path is usually not necessary and annoyingly long).

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



  reply	other threads:[~1996-05-07  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-25  4:00 Directory Prompt dhinkle
1996-05-04  4:00 ` Martin Hannigan
1996-05-06  4:00   ` Thomas Leitner
1996-05-06  4:00   ` Timothy M. Wieman
     [not found]     ` <4mnec0$r34@gli <4mt0vt$4cu@csugrad.cs.vt.edu>
1996-05-10  4:00       ` John C. Fowler
1996-05-10  4:00         ` John P. Speno
1996-05-11  4:00           ` John Hascall
1996-05-07  4:00   ` Torsten Robert Kirschner
1996-05-07  4:00     ` Dan Pop [this message]
1996-05-07  4:00       ` Kevin MacNeil
1996-05-09  4:00       ` Jeff Aitken
1996-05-14  4:00   ` David A. Lyons
1996-05-09  4:00 ` Ken Brown
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox