![]() |
| | #1 |
| Registered User Join Date: Feb 2009
Posts: 10
| Prompt \w gives relative path it shows prompt as ~/sources vivek-laptop:vivek while i want it to be like /home/vivek/sources vivek-laptop:vivek Where am I making the mistake? |
| vkaushal21 is offline | |
| | #2 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| That is not a relative path. The tilde (~) is your home directory. Eg, if you log in as root and go to the same place, you will see /home/vivek, since ~ for root is (usually) /root. I don't think you would be using the bash prompt in this way, but generally if you need to replace a ~ which has been output it is equal to the $HOME environment variable.
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS |
| MK27 is offline | |
| | #3 |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 801
| okay, let's try that again. . . you'd want to put this in (somewhere) Code: PS1="\${PWD}# "
|
| Kennedy is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Buidl Library with ./configure script | Jardon | C Programming | 6 | 07-24-2009 09:36 AM |
| How to judge whether a path is relative or absolute? | bbebfe | C Programming | 2 | 11-16-2008 03:23 AM |
| MSVC: output .pd under relative path? | pheres | Windows Programming | 0 | 02-04-2008 10:55 AM |
| Path of file relative to program | ulillillia | C Programming | 13 | 04-15-2007 05:30 AM |
| linked list recursive function spaghetti | ... | C++ Programming | 4 | 09-02-2003 02:53 PM |