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

Re: some directory changing tools to share

mkkwong@xxxxxxxxxx wrote:
>                 case $_j in
>                         .) dirname=$dirname/..
>                                 continue ;;
>                         ..) dirname=$dirname/../..
>                                 continue ;;
>                         ...) dirname=$dirname/../../..
>                                 continue ;;

This reminds me of a useful feature of 4DOS (a shareware command.com
replacement which I used to use) and I think also for shared drives in
Netware. It allowed series of dots to refer to parent directories beyond
the parent. So, ... refers to the parent of the parent, .... to the
parent of that etc. When I first moved to UNIX, I defined a series of
aliases - cd...=cd ../.. etc although I don't seem to be in the habit of
using them anymore. I also realise that I could use alias -g
'...'='../..' but this only works on single words.

Would it be possible to add an option which extends the zsh filename
generation to expand ... to ../.., .... to ../../.. etc. Would this
conflict with any of the existing globbing system? The only problem I
can foresee is that to refer to a directory named '...' it would be
necessary to quote atleast one of the dots.

Any thoughts?

Oliver Kiddle

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