LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-03-2003, 11:16 AM   #1
brian0918
Member
 
Registered: Apr 2003
Posts: 87

Rep: Reputation: 15
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.
 
Old 06-03-2003, 12:36 PM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
try using PS4 instead of PS1
PS1 only gets runned once when you start the shell, I think.
 
Old 06-03-2003, 01:50 PM   #3
brian0918
Member
 
Registered: Apr 2003
Posts: 87

Original Poster
Rep: Reputation: 15
That didn't seem to work. I replaced PS1 with PS4 in .kshrc and .profile. Neither seemed to work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I find out the current working directory? nodger Programming 2 12-26-2004 11:28 AM
ksh directory comparison script SeT Programming 4 08-30-2004 11:57 AM
edit path environment variable to include current working directory alb1954 Linux - Newbie 8 07-11-2004 11:26 PM
Placing current path in the prompt zepplin611 Linux - General 2 05-13-2004 12:07 PM
current working directory in ksh prompt brian0918 Linux - Newbie 2 06-03-2003 04:34 PM


All times are GMT -5. The time now is 04:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration