Quote:> Is it possible to change the prompt to new present directory when the
> cd command is used in a korn shell environment.
> For example,
> cd /tmp
> /tmp>
> cd /opt
> /opt>
> cd /usr/bin
> /usr/bin>
> etc.
> In other words I want something like export PS1=`pwd` with every
> execution of cd.
> Anyone with any information, please help.
> Regards
> Willy
Korn shell is easy. For Korn shell put the following in your .profile or
your .kshrc, if you're using one:
PS1='($PWD)$'
Remember to export PS1. $PWD is a shell variable that is equal to the
present working directory.
C shell uses the same variable, but the files and syntax are different.
I think that Bourne shell requires that you alias the cd command.
Check Google in comp.unix.shell. There are several postings that answer
your question.
Brian Miller
Reply address is munged. Remove the CLIPTHIS.