From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8392 invoked from network); 14 Jul 2023 14:48:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Jul 2023 14:48:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1689346105; b=EKg3Hdq9ZaxXoBeR7NqKrtsXlx8x95oJoQraIH6aC2k60uLyA3jQYpxFcJV7oVRFD7AyjAEUAx i0VXd0ybDDp0NIGMgLlqcZ7ql57Sf4xTSm79A/mdxuH9TOLu5QxajjQnNsvrbytg2jB4TeQlvy VKTkih8aHq+8f3ZoyYF11nUqBnFKno+ZLsFPbbV430S0Iz3RKX+UUEHKqOPbjBXkDpXIKn2O3+ zvxSh+wBByzQJTQswFgN9wabRdADVc03mhGRKrMdaZyeY47sTqaUoD11CWbbROQEEm/G7JMc12 /WhcmEpcINe5bO/Gx/ADVT5W7aPZk6blReDGubmqTvc1Qg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pl1-f177.google.com) smtp.remote-ip=209.85.214.177; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1689346105; bh=lE6A8J2g9W0qBAlTdZGzvQjyip6Yi2HeFsIoHKeobDE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:Reply-To: MIME-Version:DKIM-Signature:DKIM-Signature; b=hnynr87PYB4GIyZI1blzZqsMBPeGHn+o/MHhHWZRdQtY0QZdc2NA8Z5YHbhfg8mAyG8w7ABMQK bPXfZeFm9dtJRYc0ZnnjHALzP65tm4Ylfkv0AHCIAy+Kq6bANqt6wpGtOcJ8CeXJZHZteVyoIi /UzCBQbOOdoDThIpSEXqsvZrjQuZBNpRT9Tg6AQeWcHalvikPnmCfyIG8gJ+4Clv0ndtlZnoh8 5FRdvWZjWwfBd2/N0MXbM6J45iKGLCJMVuNV+GYoq/aAsAwSYfwwU1bb17skBY0RYr4Sz/A3SP UvVHaJd3pTjtzABbhCXydbUR5KS9cMkeKSG0Q4IuP8/JlA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:Reply-To:MIME-Version:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=VUL17PAj9ZMGrkUZ1Q3Mn7zaosW5V7+R3XXkYl6Syv8=; b=k4sFZA6N32nX68Xtodtye0U+XW FQXmHTI+cCcDnoNBqK6jVOX1DUK8ph6haJukFCtqvfKSyChrDZ0L2iGa9TDalLkAGozjAO7KLrkop JSU1HOwd9fYiBbIqJ/4IvW9RnAIzUmDe/u9QQpq6pBHE3iRBDyQw2QwER7jrZ5T2LJ+RWaYQgX4l/ U4qFOsmn9lo2YJTdlo4WCKwKiKfWOcaGJq130jQXpFPvbG90+BBYYZ59KpBy+/3xvkemBhxyZUlzt JJnYIUPpI+KVs6sk4oB9G1LoXOPjVl7w5Ho0vInBnE7kzc1o70chf3r2cGKuqa9bppt8xT/VhqY0V ByuWxs4g==; Received: by zero.zsh.org with local id 1qKK5n-000LIw-F7; Fri, 14 Jul 2023 14:48:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pl1-f177.google.com) smtp.remote-ip=209.85.214.177; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pl1-f177.google.com ([209.85.214.177]:49301) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qKK4a-000Ka7-Gd; Fri, 14 Jul 2023 14:47:11 +0000 Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1b8bd586086so15346275ad.2 for ; Fri, 14 Jul 2023 07:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689346026; x=1691938026; h=to:subject:message-id:date:from:reply-to:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=VUL17PAj9ZMGrkUZ1Q3Mn7zaosW5V7+R3XXkYl6Syv8=; b=BsMuOSNx9N86v3//hcFdSLnj5on6EvgaHOEB5HV2pcqO+OT6ApsUnIFH/vv4+ROfiq 7Nuv+PC/KSY67KKPZIWakRRvm/trv2Og9NUwIB6IZra62Ah7LvmVk4NpfCfI+8kRWm+c s1piU0t4Bt9lwH5JkHqx3FeB2lmkVhaikYjYgFFIr+G80j8fD3U5qoufB9l856RxoUC6 TAfxCSK9POG9k1U/Jm0WgfxibJIX8mgaDfK2oS6nVdLkbDQ+wmWpbf48KOEGCaIg/RS+ 4U78ZoEXUVxlfnEQi65RSaBTFtZHTF3JGlibF52wtBi0khgqkwt6sKUC0UuKe9fDl4Mf s+9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689346026; x=1691938026; h=to:subject:message-id:date:from:reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VUL17PAj9ZMGrkUZ1Q3Mn7zaosW5V7+R3XXkYl6Syv8=; b=FC0+9usxcSCz+gNOUabVZ8kwNvPKZpx+qB8E+ckS4MKP44/Nc1ydlhim7zQWCV/wc9 szwKegX+FemsS3gNBxhouiUtx0RfjKeqKNbOnd6bqD7bttXFoxtvfeH9ivLioY/T+Yq5 164Y6TWZ7OmFyviF1mMwHZ7a21u5fytK3LRC7i8tdb0laWeG2x4LMIRbd9yJ+O6JOq6c ZqjlW9b2o8OtLvZ6ikDzckcEDGwHE8VrF8lq/PKyb0XLjSO6o+aeBzTIa9VV4mcG3R3I ANtb0lugRT0Ax5UbIJ9o3q3ncWAzgzcngP+7ThtJslrINbmiNfWJPF4izJxDwT4QCojn HP7A== X-Gm-Message-State: ABy/qLZ/3gGs9jlF8iYACWE+XapfkQnO8AmOzrOue743ObxTB1H3S5wa kHlBS6H8x0+JYNl503Bc+er8llkGOteQ3ez+cQo+qeqP X-Google-Smtp-Source: APBJJlH4wLwQ4mDvKP9H0l5y04boQatSCLgDnlpKfF72ARUpWCEtie1BIUAD/dcnTmcXBbDqSuUlahKZhL4CoIbWVlQ= X-Received: by 2002:a17:902:7c04:b0:1ba:ff05:d8b1 with SMTP id x4-20020a1709027c0400b001baff05d8b1mr4619000pll.19.1689346026019; Fri, 14 Jul 2023 07:47:06 -0700 (PDT) MIME-Version: 1.0 Reply-To: linuxtechguy@gmail.com From: Jim Date: Fri, 14 Jul 2023 09:46:55 -0500 Message-ID: Subject: alias/anon_function quoting issue To: zsh Content-Type: multipart/alternative; boundary="000000000000c8a1d30600738580" X-Seq: 29106 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000c8a1d30600738580 Content-Type: text/plain; charset="UTF-8" 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:: bad pattern: name=() 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 --000000000000c8a1d30600738580 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone,
First, admittedly w= hat 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.=C2=A0 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 s= et a parameter with
ansi data.

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

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

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

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

So far everything I have tr= ied hasn't worked.

FYI, the alias itself is us= ing single quotes to surround the anon_function.
alias name=3D= 9;(){
=C2=A0=C2=A0 ...
}'

<= div>Q:=C2=A0 Is something like this possible?
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 If so, does anyone have an idea how to do this?

=
Note:=C2=A0 This is not critical, just annoying that "I&quo= t; can't figure it out.

Thanks, and best regar= ds to all,

Jim Murphy
--000000000000c8a1d30600738580--