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

Matching delimiters for the "e" glob qualifier (Was: [Feature Request] Adding option to support triple quotes)



2019-08-18 06:24:32 +0200, Mikael Magnusson:
> On 8/17/19, Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> >
> > On a related note, I really wish the glob*(e'(code $(...))')
> > worked, as in the code that looks for the closing ) for the e
> > glob qualifier would find the matching ")" as opposed to the
> > first one (same in the s/j... parameter expansion flags, etc.)
> 
> You probably want glob*(e*'code $(...)'*), an unquoted * will never
> match a quoted *, eg:
> % echo .(e*'touch \*hi; reply=("*"*)'*)
> *hi
[...]

Thanks,

I'm not sure why it works of why it doesn't work with other
characters (it seems to work with ? as well though), but I can
confirm it does and it's very handy indeed.

Are we guaranteed it will stay that way?

I've just realised we can also do:

echo .(e'
 single-line code
')

BTW, this doesn't look right:

$ (echo a(eé'echo é'é)) |& sed -n l
zsh: unknown file attribute: ^\003$

-- 
Stephane



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