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

Re: alias/anon_function quoting issue



On Fri, Jul 14, 2023 at 4:48 PM Jim <linux.tech.guy@xxxxxxxxx> wrote:
>
> e.g. Var=$'\e['

You don't need to quote the dollar sign within single quotes. The
single quote itself can be quoted by replacing it with '\'': the first
single quote closes the open one, \' inserts a literal single quote,
and the last single quote reopens the string literal.

    alias name='() {
      Var=$'\''\e['\''
    }'

Roman.




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