Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you get the command line to show pwd ?

Status
Not open for further replies.
Apr 2, 2002
25
US
How do you get the command line prompt to allways show your pwd ?

So that each time you change to a new dir. it will be listed at the command promt ?

Thanks
 
for ksh, do something like that:
export PS1="[\t \$LOGNAME@$(hostname):\$PWD] " vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
even more fun put this in your .kshrc:

CD1(){
x=$1
cd $x
PS1=$(basename $(dirname $PWD))/$(basename $PWD)
if [ -d /$PS1 ] ;then
PS1=$PWD
else
PS1=.../$PS1
fi
PS1=&quot;[$(hostname):$PS1]# &quot;
}
alias cd='CD1'


Regards Gregor Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top