Machine Type: i686-pc-linux-gnu
Bash Version: 3.1
Patch Level: 17
Release Status: release
Description:
If any part of cwd is a symlink, file completion when you try to navigate
above that part follows the logical path. This is in conflict with all
coreutils commands that use the physical path.
---
In an ideal world I think bash's completion makes more sense than coreutils
semantics. But after looking into coreutils sources and ext2 documentation
(http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.11.tar.bz:Documentation/filesystems/ext2.txt
or http://www.mjmwired.net/kernel/Documentation/filesystems/ext2.txt)
I conclude that the 'logical path' is maintained only by the shell, not in
the filesystem. If I'm right, then the whole notion of logical path is a
leaky abstraction honored only by 'cd -L' [anybody else?]. I would
really like to be told I'm wrong.
Repeat-By:
$ mkdir base_dir
$ cd base_dir
$ mkdir -p x/y
$ ln -s x/y f
$ cd f
$ ls ..
y
##### Testing out tab-completion
$ ls ../<Tab>
f x
##### stat("../f") returns ENOENT.
$ cat > x.c
#include<stdio.h>
#include<sys/stat.h>
#include<errno.h>
struct stat buf ;
int main () {
printf ("%d %d\n", stat("../f", &buf), errno);
}
$ gcc x.c
$ a.out
-1 2
Kartik