bash incorrect shows workdir

Bug #1934591 reported by nik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
Invalid
Undecided
Unassigned

Bug Description

Hello.
bash is working incorrect, showing not existing workdir (pwd command) when I enter command:
cd dirlink , where dirlink is symbolik link to directory.
Best regards, Nikolay

Revision history for this message
nik (niknikos) wrote :
Revision history for this message
Thomas Bechtold (toabctl) wrote :

Hi Nikolay,

thanks for reporting this bug. I can't follow. Could you please share what you would expect when calling `pwd` ?

Changed in cloud-images:
status: New → Incomplete
Revision history for this message
nik (niknikos) wrote : Re: [Bug 1934591] Re: bash incorrect shows workdir

Hi, Thomas
'pwd' , I gess, must show the same as 'ls . ' .But the mistake is in the command - line bash.( pls, see attachment)
Best regards

> Hi Nikolay,
>
> thanks for reporting this bug. I can't follow. Could you please share
> what you would expect when calling `pwd` ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1934591
>
> Title:
> bash incorrect shows workdir
>
> Status in cloud-images:
> New
>
> Bug description:
> Hello.
> bash is working incorrect, showing not existing workdir (pwd command) when I enter command:
> cd dirlink , where dirlink is symbolik link to directory.
> Best regards, Nikolay
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cloud-images/+bug/1934591/+subscriptions

Revision history for this message
nik (niknikos) wrote :

Hi Thomas
last letter was incorrect, sorry
I gess, that bash must show real workdir, '~$' or '/home/nik$' . Command 'pwd' must show the same real work dir.
Commands 'ls 'pwd' ' and 'ls . ' I think would show the same output.

Regards

> Hi Nikolay,
>
> thanks for reporting this bug. I can't follow. Could you please share
> what you would expect when calling `pwd` ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1934591
>
> Title:
> bash incorrect shows workdir
>
> Status in cloud-images:
> New
>
> Bug description:
> Hello.
> bash is working incorrect, showing not existing workdir (pwd command) when I enter command:
> cd dirlink , where dirlink is symbolik link to directory.
> Best regards, Nikolay
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cloud-images/+bug/1934591/+subscriptions

Revision history for this message
Gauthier Jolly (gjolly) wrote :

Hi Nikolay,

pwd is both a shell built-in command and a binary (provided by coreutils).

As you found out, the built-in command shows the path the user used to access the current directory, including symlinks. You can read more about this build-in command by looking in the man page for bash (just run "man bash" and look for "pwd"). This is a known feature and not a bug. To show the "real" path without the symlinks, you can either run "pwd -P" or use the binary provided the package 'coreutils': just run "/bin/pwd".

If you don't like this behaviour, feel free to modify your bash prompt. To do so, you can edit the PS1 variable in ~/.bashrc (if you use the default bashrc) and replace "\w" by "$(/bin/pwd)". For example if your prompt is set this way:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

You can modify it this way:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]$(/bin/pwd)\[\033[00m\]\$ '

Don't forget to source this file to see the changes in your current session: "source ~/.bashrc"

Best regards,
Gauthier

Changed in cloud-images:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.