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

Old 'cd ......' function broken.



I got this from the zsh mailing list a while ago.  It used to work but no more
(zsh-3.0.0).  It doesnt like ${(r:(${#1}-1)*3-1::../:)b}

cd() {
  if [[ $# -eq 1 && $1 = ...* ]] then
    local b=''
    a=${(r:(${#1}-1)*3-1::../:)b}
    builtin cd $a
  else
    builtin cd $*
  fi
}

% cd ...
zsh: ')' expected

Can someone tell me how to fix it?



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