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

Re: Should we backup this change? RE: Modifier substitutions.



On Apr 12,  4:26pm, Andrej Borsenkow wrote:
} Subject: Should we backup this change? RE: Modifier substitutions.
}
} There was no reply ... so I ask once more: should we backup this change?
} 
} > -----Original Message-----
} > > The `#' is being interpreted as an anchor at the head of the
} > > string even
} > > when buried inside $old.  I have a feeling that wasn't my intention.
} > >
} >
} > Erm ... it was done by Bart (do not have arcticle number handy) as a
} > result of my question.

On Apr 12,  2:34pm, Sven Wischnowsky wrote:
}
} I would be in favour of that. The possible confusion when
} forgetting to check/quote the `#' and `%' at the beginning of
} parameters used there is more important than the advantage, I think.

The change went in in 6002.  It was followed in 6003 by a change to allow
a leading double backslash to escape the delimiter.  So all you need to
do is change uses of ${foo/$bar/...} into ${foo/\\$bar/...} to avoid the
confusion.  And without 6002, there's no way to build up an anchored
pattern in a variable (which was Andrej's original complaint).

Also, though I'm the last person to argue for keeping a change solely for
compatibility, bash recognizes the same syntaxes.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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