Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: :r modifier



>>> "Andrej" == Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx> writes:

 >> 
 Bart> :Do we need to teach :h/:t about the leading-double-slash
 Bart> convention for some networked file systems?
 >> 
 >> I don't know, I never seen such file systems.

 Andrej> May be, you have heard about one. It is called Windows
 Andrej> and (sometimes) runs on x86 PC-compatible systems :-)

:o)

By the meantime I have been pointed to the Texinfo documentation
of Autoconf (>=2.49a) which reads as follow.

`dirname'
     Not all hosts have `dirname', but it is reasonably easy to
     emulate, e.g.:
          
          dir=`expr "x$file" : 'x\(.*\)/[^/]*' \|
                    '.'      : '.'

     But there are a few subtilities, e.g., under UN*X, should `//1'
     give `/'?  Paul Eggert answers:
          
          No, under some older flavors of Unix, leading `//' is a
          special path name: it refers to a "super-root" and is used to
          access other machines' files.  Leading `///', `////', etc.
          are equivalent to `/'; but leading `//' is special.  I think
          this tradition started with Apollo Domain/OS, an OS that is
          still in use on some older hosts.
          
          POSIX.2 allows but does not require the special treatment for
          `//'.  It says that the behavior of dirname on path names of
          the form `//([^/]+/*)?'  is implementation defined.  In these
          cases, GNU `dirname' returns `/', but it's more portable to
          return `//' as this works even on those older flavors of Unix.
          
          I have heard rumors that this special treatment of `//' may be
          dropped in future versions of POSIX, but for now it's still
          the standard.

 Andrej> I checked bash and it behaves the same as zsh. 

Huh?  You aren't speaking about :h here, are you?

 Andrej> On Cygwin bash is just as ignorant about special Win32
 Andrej> names as zsh is. It does not mean we should follow the
 Andrej> suite - but, at least, we are in good company as it
 Andrej> stand now :))
-- 
Alexandre Duret-Lutz



Messages sorted by: Reverse Date, Date, Thread, Author