xfs
[Top] [All Lists]

Re: Soft links to directories

To: Ayose <colario@xxxxxxxxxxxx>
Subject: Re: Soft links to directories
From: Keith Owens <kaos@xxxxxxxxxxxxxxxxx>
Date: Sun, 16 Dec 2001 10:23:21 +1100
Cc: linux-xfs <linux-xfs@xxxxxxxxxxx>
In-reply-to: Your message of "Sat, 15 Dec 2001 19:09:02 -0000." <3C1B9FCE.7000409@xxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Sat, 15 Dec 2001 19:09:02 +0000, 
Ayose <colario@xxxxxxxxxxxx> wrote:
>[0]a$ mkdir -p aa/aaa/ bb/bbb/bbb cc/ccc
>[0]a$ cd aa/
>[0]aa$ ln -s ../bb/bbb/bbb/
>[0]aa$ cd bbb
>[0]bbb$ pwd
>/tmp/a/aa/bbb
>[0]bbb$ ln -s ../ # I hit TAB
>aaa  bbb

bash is doing file completion for ../ based on _two_ directories,
/tmp/a/aa/bbb (entered via symlink) and /tmp/bb/bbb/bbb (the real
directory name), so it displays names from both directories.  pwd is a
bash internal that displays the symlink path, use /bin/pwd to see the
real working directory according to the kernel.

The bash "feature" of listing names in both the real and symlink parent
directory is useful most of the time.  But as you have found out, it
does not work when creating relative symlinks.  This has nothing to do
with xfs or even the kernel, it is bash.


<Prev in Thread] Current Thread [Next in Thread>