When I use \w to set my prompt in bashrc (using ubuntu, if it makes a difference)
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?
This is a discussion on Prompt \w gives relative path within the Linux Programming forums, part of the Platform Specific Boards category; When I use \w to set my prompt in bashrc (using ubuntu, if it makes a difference) it shows prompt ...
When I use \w to set my prompt in bashrc (using ubuntu, if it makes a difference)
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?
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.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
okay, let's try that again. . . you'd want to put this in (somewhere)and the best thing to do is to try it out first via export PS1="\${PWD}# "Code:PS1="\${PWD}# "