bash behaves different on symlinks than the GNU tools

Bug #503761 reported by Philip Muškovac
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Gnu Bash
Invalid
Undecided
Unassigned
bash (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: bash

as example I have 'ln -s /tmp $HOME/tmp'

when I now cd into tmp/ I correcty get to the /tmp folder, cd .. gets me back to ~. So far so good.
now... when I'm in tmp and try to work with bash auto-completion or pwd I can't use cp, rm, mv, file, stat, etc... anymore
when I do 'cp ../.bashr<tab>' it gets auto-completed to 'cp ../.bashrc'
but when I actually run the command 'cp ../.bashrc .' I get
cp: cannot stat `../.bashrc': No such file or directory

you easily find out why that happens with 'ls ..' which shows
bin cdrom etc initrd.img lib mnt proc sbin srv tmp var vmlinuz.old
boot dev home initrd.img.old media opt root selinux sys usr vmlinuz

and finally pwd shows that bash and the GNU tools think differently:
$ pwd
/home/yofel/tmp
$ /bin/pwd
/tmp

ProblemType: Bug
Architecture: i386
Date: Wed Jan 6 12:33:52 2010
DistroRelease: Ubuntu 10.04
Package: bash 4.1-1ubuntu1
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-9.13-generic
SourcePackage: bash
Tags: lucid
Uname: Linux 2.6.32-9-generic i686

Revision history for this message
Philip Muškovac (yofel) wrote :
Changed in bash (Ubuntu):
status: New → Confirmed
Revision history for this message
Philip Muškovac (yofel) wrote :
Changed in gnubash:
status: Unknown → New
Revision history for this message
Jilles Tjoelker (jilles) wrote :

This bug should be tightened down to the completion only.

The discrepancy between cd and pwd on one hand and other utilities on the other hand is inevitable (unless you disable the symlink magic using set -P).

I consider the fact that /bin/pwd shows the path without symlinks a bug in GNU coreutils. It lacks the -L and -P options also.

Revision history for this message
dino99 (9d9) wrote :

EOL reached or very close. Time to use some newer version.

Changed in gnubash:
importance: Unknown → Undecided
status: New → Invalid
Changed in bash (Ubuntu):
status: Confirmed → 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.