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

Re: Old 'cd ......' function broken.



peta@xxxxxxxxxxxxx wrote:
> 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}

It looks like the expression after the first : isn't being interpreted
as a mathematical expression for evaluation any more.  Somebody will
know if this is a feature, otherwise it's a bug.  You can get away
with:

eval "a=\${(r:$(((${#1}-1)*3-1))::../:)b}"

which evaluates the expression first.

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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