Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Mar 1996 07:51:28 -0600
From:      "Paul T. Root" <ptroot@uswest.com>
To:        Gabor Zahemszky <zgabor@code.hu>
Cc:        Mike Coffey & Yvonne Shevnin <mikec@mediacity.com>, freebsd-questions@freebsd.org
Subject:   Re: How to make current directory show at the commandline?
Message-ID:  <31482460.754D@uswest.com>
References:  <199603131507.PAA00889@CoDe.CoDe.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
Gabor Zahemszky wrote:
> 
> >
> > I would like the current directory that I am at to display at the command
> > line like it does in DOS. Is there anyway to emulate this?
> >
> > Thanks-- Yvonne Shevnin
> >
> 
> in csh (not tcsh):
> alias cd 'cd \!* ; set prompt = "$cwd "'
> and after it, make a cd .
> in ksh/pdksh:
> PS1='$PWD '
> 
> You cannot do it in sh (ash)

One should never say cannot:

For sh/ksh/pdksh/bash: (though there are better ways for ksh/pdksh/bash)

Define a function in your .profile:

cd()
{
   chdir $*
   PS1="`pwd`"
}




> --
>         Gabor Zahemszky <zgabor@CoDe.hu>
> 
> -:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
> Earth is the cradle of human sense, but you can't stay in the cradle forever.
>                                                 Tsiolkovsky

-- 
Paul T. Root 			E/Mail: ptroot@uswest.com
200 S. 5th St. Suite 1100	PAG: +1 (800) SKY-PAGE PIN: 537-7370
Minneapolis, MN  55402		WRK: +1 (612) 663-1979
NIC:	PTR			FAX: +1 (612) 663-8030



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31482460.754D>