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

alias/anon_function quoting issue



Hi everyone,
First, admittedly what I'm trying to do can be done in a regular function without
an issue. That said, I just hate giving up trying to make it work.(sorry)

In my .aliases file I have a number of alias/anon_functions defined.  This is so I can pass
an arg using an alias, as an alias can not accept arguments. This normally works well,
but I ran into an issue when within the anon_function I tried to set a parameter with
ansi data.

e.g. Var=$'\e['

When trying to read in the aliases form my .aliases file I get the following:

. ~/.aliases
/home/user/.aliases:<line no>: bad pattern: name=() <some code> Var=$\e['

Have tried a number of different quoting changes, like:
    "\" in front of single quotes
    using double quotes instead of single quotes in different places
      (not sure if I was doing this correctly ... but tried anyway)

So far everything I have tried hasn't worked.

FYI, the alias itself is using single quotes to surround the anon_function.
alias name='(){
   ...
}'

Q:  Is something like this possible?
      If so, does anyone have an idea how to do this?

Note:  This is not critical, just annoying that "I" can't figure it out.

Thanks, and best regards to all,

Jim Murphy


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