zsh-users
 help / color / mirror / code / Atom feed
* alias/anon_function quoting issue
@ 2023-07-14 14:46 Jim
  2023-07-14 15:06 ` Roman Perepelitsa
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jim @ 2023-07-14 14:46 UTC (permalink / raw)
  To: zsh

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1768 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-28 21:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 14:46 alias/anon_function quoting issue Jim
2023-07-14 15:06 ` Roman Perepelitsa
2023-07-14 16:42 ` Bart Schaefer
2023-07-14 16:52   ` Bart Schaefer
2023-07-14 21:24   ` Jim
2023-07-27  8:50 ` Johan Grande
2023-07-28 21:53   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).