On Thu, 15 Dec 2005, Netocrat wrote:

> Axel Liljencrantz wrote:
> [cd'ing to a link directory in bash]
> > So cd and pwd don't change to the linked-to directory, but IO
> > redirections and the ls command do. As does every other non-builtin.
> > I think it is much more important to have consistency.
>
> That's reasonable - I'm just not accustomed to the link directory name
> being automatically resolved since bash doesn't do it.
>
> POSIX specifies that whether linking to directories is supported is
> implementation-defined, and it doesn't specify what semantics chdir(2)
> and getcwd(3) should have in this situation.
>
> Under Linux the behaviour of these syscalls corresponds to fish's
> behaviour, so bash/zsh are "hiding the real directory" - as confirmed by
> running /bin/pwd rather than the builtins.

Both approaches are reasonable. I wouldn't care either way as long as
everything is done consistently. The problem is that bash approach
_can't_ be done consistently.

Take the command 'foo ..' for example. If you are in the ~/data/link
directory, it might be reasonable to expand '..' to '~/data', to
maintain the link consistency. But what if '..' is not in fact a
directory but a regexp? The fish way is the only way to get a
consistent directory resolution across all commands and situations,
and that is why I chose it.

>
> --
> http://members.dodo.com.au/~netocrat
>

-- 
Axel


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to