*BSD News Article 82534


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!uwm.edu!www.nntp.primenet.com!nntp.primenet.com!news.bbnplanet.com!cpk-news-hub1.bbnplanet.com!newsfeed.internetmci.com!howland.erols.net!news.mathworks.com!uunet!in2.uu.net!news2.new-york.net!actcom.co.il!baum
From: Alexander Indenbaum <baum@actcom.co.il>
Subject: Re: Prompt won't show `pwd`
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Nntp-Posting-User: baum
To: Kurt Olsen <kurto@cc.usu.edu>
Message-ID: <Pine.SUN.3.93-heb-2.07.961108225125.14941B-100000@actcom.co.il>
References: <327D7D20.1467@auburn.campus.mci.net> <1996Nov5.145304.88491@cc.usu.edu>
Mime-Version: 1.0
X-Trace: 847486402/3996
In-Reply-To: <1996Nov5.145304.88491@cc.usu.edu>
X-Nntp-Posting-Host: actcom.co.il
Date: Fri, 8 Nov 1996 20:54:21 GMT
Lines: 54

Hi!
I'd advise you to use tcsh and just enter one line into .cshrc

set prompt = "%t %m -> %/>"

It gives you promt like:

10:52pm actcom -> /u/ac/baum>

Nice is not it?
man tcsh for more details...

  Alexander Indenbaum
  baum@actcom.co.il


On 5 Nov 1996, Kurt Olsen wrote:

> In article <327D7D20.1467@auburn.campus.mci.net>, Anthony Jenkins <ajenkins@auburn.campus.mci.net> writes:
> > How do I get my shell prompt (csh or sh) to show the current working
> > directory every time it is printed?  Setting prompt to "`pwd`#" only
> > sets the prompt to the directory I am in when I issue the set command;
> > cd-ing to another directory doesn't affect the prompt.  Thanks in
> > advance.
> > 
> > Anthony
> 
> Well, this is what I do:
> 
> if ( $?DISPLAY ) then
> alias showpath 'echo -n "^[]2;`hostname -s` - `pwd | sed -esl/usr/user/kurtol
> kurtol`^G"'
> else
> alias showpath 'set prompt="`hostname -s`:`pwd | sed -esl/usr/user/kurtolkurtol`> "'
> endif
> #
> showpath
> alias cd "cd \!*; showpath"
> alias pushd "pushd \!*; showpath"
> alias popd "popd \!*; showpath"
> alias telnet "telnet \!*; showpath"
> 
> All that's in my .login.  The first showpath alias is for xterms (it's
> probably missing some control codes) and it set's my host and path to
> the title of the xterm.  The second is when I'm, not on anxterm and
> it sets my prompt.  Whenever I use cd, pushd, popd, telnet it does
> the command and executes showpath.
> 
> Some shells have a variably that will automatically do this for you.
> -- 
> Kurt Olsen (kurto@cc.usu.edu)
> <a href="http://www.mcs.usu.edu/~kurto/">Me & my Atari Lynx</a> archive.
>