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

Re: PATCH: expanding parameters like echo/print builtins



On 11 May 2011 17:03, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 11,  3:02pm, Mikael Magnusson wrote:
> } Subject: PATCH: expanding parameters like echo/print builtins
> }
> } Is this already possible? I had an array with a lot of \u1234 escapes
> } in it, and couldn't find a way to do it easily.
>
> I'd probably have done it with ${(%)arr:gs/%/%%}

Yeah, me too, except (%) doesn't expand \u304c or \0123, or any of the
other stuff that (g) expands :).

> [...] I don't have
> any objection to the (g) flag except to wonder if another choice for
> the letter (g) might be better.  The fact that it mnemes to GETKEY_
> isn't going to be very helpful to most users.
>
> But I don't have the list of available letters handy. :-)

I looked at the list of letters and the first free one was b, so i
picked that, then when i got as far as discover that the function is
called getkeystring and noticed g was also free, i went with that. e
is taken (for echo), and p which does the same for subsequent flags is
taken, and P is also taken. If anyone has a better mnemonic in mind,
feel free to suggest it. The following characters are taken:
#%@AacCDefFikLnoOPqQtuUvVwWXz0p~jlmrsZ_lBEMNR

-- 
Mikael Magnusson



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