You are not logged in.

#1 2010-01-30 00:25:30

waxar
Member
Registered: 2009-10-07
Posts: 3

The prompt '\w' identifier works strange

Hey, all!

Please consider this:

root@spark:~>su - synd
[03:20:26]
synd@spark:~>echo $HOME
/opt/http/synd/
[03:20:33]
synd@spark:~>echo $PS1
[\[\e[32;1m\]\t\[\e[0m\]]\n\u@\h:\w>
[03:20:36]
synd@spark:~>cd wwwroot/
[03:20:42]
synd@spark:/opt/http/synd/wwwroot>


'\w' should be replaced by the current working directory, i.e. /opt/http/synd/. However, you can see the resulting prompt in the last line which has no tilde (~); suppose '/opt/home/synd' should be replaced. Others users don't have such an issue. What am I doing wrong in this simple thing?

Offline

#2 2010-01-30 05:30:24

jwbirdsong
Member
From: Western KS USA
Registered: 2006-11-25
Posts: 173

Re: The prompt '\w' identifier works strange

try a capital W


PLEASE read and try to FIX/FILE BUGS instead of assuming other have/will.

Offline

#3 2010-01-30 12:35:13

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: The prompt '\w' identifier works strange

Check your /etc/passwd file, do you have a trailing / at the end of you home directory?

ie,

BAD

http:x:33:33:http:/srv/http/:/bin/false

GOOD

http:x:33:33:http:/srv/http:/bin/false

Offline

#4 2010-01-30 18:09:42

waxar
Member
Registered: 2009-10-07
Posts: 3

Re: The prompt '\w' identifier works strange

fumbles wrote:

Check your /etc/passwd file, do you have a trailing / at the end of you home directory?

ie,

BAD

http:x:33:33:http:/srv/http/:/bin/false

GOOD

http:x:33:33:http:/srv/http:/bin/false

Thank you so much! That was a clue.

Offline

Board footer

Powered by FluxBB