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

Re: hzoli change: $foo:s//r/



Anthony Heading wrote:
> 
> Sorry I missed this first time round.
> 
> hzoli changelog of Jul 10 says:
> - $foo:s//r/ gives ... error message ... (194)
> 
> Now the following used to work
> 
> % array=(a b c d e)
> % echo $array:s//\&-\&/
> a-a b-b c-c d-d e-e
> 
> I remember I had a use for this once...

The problem is that the manual says that zsh should use the left-hand-side of
the last substitution if the substitution string is empty.  And the history
code also does this.  Also the code in hist.c which produced that feature you
describe was buggy and it sometimes got into an infinite loop (or did some
even worse thing).  So what you used so far was probably an undocumented bug.
Maybe we can find an other syntax for that.

Zoltan



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