Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: alias/anon_function quoting issue
- X-seq: zsh-users 29109
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: linuxtechguy@xxxxxxxxx
- Cc: zsh <zsh-users@xxxxxxx>
- Subject: Re: alias/anon_function quoting issue
- Date: Fri, 14 Jul 2023 09:52:21 -0700
- Archived-at: <https://zsh.org/users/29109>
- In-reply-to: <CAH+w=7Yc8W3xBcjfwbPJ=ts_Fw3DVA7xOD3jFn5ET5c8F2QA8w@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CA+rB6GJ_opAWNCCBbQC=KQLwvYpjJ2Z6SK+yNjXqpuYyfKN+aw@mail.gmail.com> <CAH+w=7Yc8W3xBcjfwbPJ=ts_Fw3DVA7xOD3jFn5ET5c8F2QA8w@mail.gmail.com>
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