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

Re: alias/anon_function quoting issue



On Fri, Jul 14, 2023 at 9:42 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
>     alias foo
>
> The shell will use a bit more elaborate quoting than strictly
> necessary in some cases

To clarify that:  The output of the "alias" command will use elaborate
quoting, not the internal representation of the alias.  You can see it
in a less convoluted form by examining the $alliases parameter:

% print -r -- $aliases[foo]
() {     Var=$'\e['  }

Or to get what you were originally after, single quoting:

% print -r -- ${(qq)aliases[foo]}
'() {     Var=$'\''\e['\''  }'




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