prompt display when cd to dir symoblic link

santosh ysan99 at gmail.com
Wed Apr 1 13:42:32 UTC 2015


On Wed, Apr 1, 2015 at 5:48 PM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> On Wed, Apr 1, 2015 at 4:39 AM, santosh <ysan99 at gmail.com> wrote:
>> Hello!
>>
>> I have a link to directory.
>>
>> /var/test --> /hdd1/test.
>>
>> /$pwd
>> /
>> $cd /var/test
>> /hdd/test$
>>
>> The prompt's PS1 w should displays real directory name.
>> I like it to display like
>>
>> /var/test$
>>
>> Is there anything I can configure to get this behavior?
>
> No.
>
> In Unix, current directory is always physical.
> You can't really "cd to a symlink".
> When you do that, your current directory
> will be where symlink points to, not the symlink.

But busybox ash prompt displays physical unlike bash..

Here I'm pasting the output from bash and busybox ash.

BASH:
root at cmx52:~# ll /var/test
lrwxrwxrwx    1 root     root            10 Apr  1 13:35 /var/test -> /hdd1/test
root at cmx52:~# echo $PS1
\u@\h:\w\$
root at cmx52:~# cd /var/test
root at cmx52:/var/test# pwd
/var/test
root at cmx52:/var/test#

Busybox ASH:
root at cmx52:~# ll /var/test/
total 2
drwxr-xr-x    2 root     root          1024 Apr  1 13:35 .
drwxr-xr-x    3 root     root          1024 Apr  1 13:33 ..
root at cmx52:~# ll /var/test
lrwxrwxrwx    1 root     root            10 Apr  1 13:35 /var/test -> /hdd1/test
root at cmx52:~# echo $PS1
\u@\h:\w\$
root at cmx52:~# cd /var/test/
root at cmx52:/hdd1/test# pwd
/var/test
root at cmx52:/hdd1/test#

I just want busybox ash to display the prompt same as ash.

Thanks.


More information about the busybox mailing list