[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange bash complementation behavior
From: |
Paul Jarc |
Subject: |
Re: Strange bash complementation behavior |
Date: |
Wed, 12 Jan 2005 10:42:37 -0500 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
Erik Wasser <erik.wasser@iquer.net> wrote:
> % ls -dl perl projects projects/perl
> lrwxrwxrwx 1 fuzz users 13 Jan 9 00:21 perl -> projects/perl
> drwxrwxr-x 15 fuzz fuzz 4096 Jan 11 14:12 projects
> drwxr-xr-x 108 fuzz fuzz 8192 Jan 11 15:48 projects/perl
> % cd perl
> % ls ../proj<TAB>
>
> the complementation turns this into 'ls ../projects<SPACE>'. Why is
> there a <SPACE> (instead of a '/')?
Since you are actually in the projects/perl directory, there is no
../projects, and ls will tell you that. bash is warning you about
this here, in a way. bash knows what path you used to reach this
directory, so it can pretend that ../projects exists, but that path
won't be meaningful to other programs, since they only see the current
state, and not your history.
> Where is the error? I think 'cd' is a shell builtin and interpretes the
> '..' in a different way than the shell command 'ls'.
Yes. cd is a builtin command, so it can take advantage of extra
information, which isn't available to ls.
paul