LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   current working directory in ksh prompt (https://www.linuxquestions.org/questions/linux-software-2/current-working-directory-in-ksh-prompt-63418/)

brian0918 06-03-2003 11:16 AM

current working directory in ksh prompt
 
I am trying to have the ksh prompt display the current working directory WITHOUT displaying all the directories above it. I checked online, and everywhere it says I should use ${PWD##*/}, so in both my .profile and .kshrc, i added this:

PS1="${PWD##*/} $ "
export PS1

i then used . .kshrc and . .profile, but noticed that it only displayed my home folder, and when I would change folders, it still displayed that same home folder. What could the problem be?

IOW, if my home folder (where my .profile and .kshrc are) was "home", the prompt looks like:

home $

but when I switch to a different directory, the prompt is still:

home $


Thanks for any help.

niknah 06-03-2003 12:36 PM

try using PS4 instead of PS1
PS1 only gets runned once when you start the shell, I think.

brian0918 06-03-2003 01:50 PM

That didn't seem to work. I replaced PS1 with PS4 in .kshrc and .profile. Neither seemed to work.


All times are GMT -5. The time now is 05:25 PM.