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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 19610 invoked from network); 4 Jan 2024 18:56:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Jan 2024 18:56:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1704394593; b=YqoxQnKpbYk8pXqBx7eDh5FeGmehOAkwgkecrO2dcKtH1yuhsEmLQn00DNIY1ua4mWy3RPXNVj nnnSgGlRfV8h4dHl11VEpFRyRuKBwOWMzIkcVfMwAQzyodqec42+ejlkAO1zt+16bXKIwMpIhr 4LxcBpAFAj9TTC4RU0MmrTXRfr3mcTMD69XvqinUzx9w/p+gYHWsFUbrqj9RQmTXGJ52no41+8 LkjnKcEBoTH0FX/Ghzx6rhxzVkxXNTAjC6V/C/L39/fN0J8BbbHGApMYhs6xIop+LRj9hQtE78 KWOdTd6GR1Y6GEAxvlb3zkjWSgorQKrQhfFBxEiBgFik2Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay5-d.mail.gandi.net) smtp.remote-ip=217.70.183.197; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1704394593; bh=c6xFpvj5ISL6+mo+8sF+VeVVY5IXHxStzwgn7mIawJA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:References:In-Reply-To:Subject:To:From:Date:DKIM-Signature; b=nXrl8P4dqAt2lNtWSKyP3q2aTuymFSdPH7XNU//LrBTZMboi05Dcl/H0BArZ3qsH8z6N207uwZ up+FqmqlJAoalWxk/6bMFOTw5uxLCkjyuJ2l/u+Ei+iBoIrU/q5ozNqn5CBrpvBeXrsBcYM0bJ otN1GeAYYED8X93bovdWcoU5YLzxbGkgCxlAqTz172SBTIr/5RFRQwH+05h0PiSyb8XP7LPhgy y48hq8oRl7GQQ28nfppcukeoIy6tlhptSa0HFsfFJ97KZc+Z1bEe3YAkPdXexhTJdho2ZAqsUF glYTOdBuZ4SlrpQkftaGbmwlr1ZV9Imx99pTYM10Wh0a8g==; 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-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:References:In-Reply-To:Subject:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=iqPFyb23NEjR64GT+mgfyvoxs7+7jMrnKYb4y84SQFU=; b=RWaCNIJjWj2FEzcbezakIBGjYY 9OhaxQ9El6TAXeZYMv3sVGsiIXZLFB4OJStLsu0wvptm02oqSxKTEuESlsi+AAryKhk1RXvIg7CRV dzm2nKtk78iEfcIH3dkMP84CH/XFJH7etv/w+0E7gcMDSkox3r0utCquTyqT5zKEAfKgqj5YQs9Av ZgIjDg3FE+rBK1Y5ta8g+AH2ksfbuAsgtEpKXqNZM8ib5ryAMK835LHhWlVmD0EmazQXNK7I/biLn fc7+6BUMNrCjjuddPBctYMd+QKMkaJBcVoaafU+cF5uO2exsZAmYkhyOOh6KcpaCE9rCAu4bOzXW8 B+UBJVKA==; Received: by zero.zsh.org with local id 1rLStM-0008MA-V3; Thu, 04 Jan 2024 18:56:32 +0000 Authentication-Results: zsh.org; iprev=pass (relay5-d.mail.gandi.net) smtp.remote-ip=217.70.183.197; dmarc=none header.from=chazelas.org; arc=none Received: from relay5-d.mail.gandi.net ([217.70.183.197]:49557) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1rLSsl-0007fB-Fi; Thu, 04 Jan 2024 18:55:56 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 73EEE1C0002 for ; Thu, 4 Jan 2024 18:55:54 +0000 (UTC) Date: Thu, 04 Jan 2024 18:55:49 +0000 From: Stephane Chazelas To: zsh-users@zsh.org Subject: Re: Disable most shell expansion to function or script User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <3FB4E4A0-787F-4C8C-A49C-FE3D18FDE9D4@chazelas.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----PYU4A13XW947V4FWFFP9QV7EB8O5AD Content-Transfer-Encoding: 7bit X-GND-Sasl: stephane@chazelas.org X-Seq: 29412 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: ------PYU4A13XW947V4FWFFP9QV7EB8O5AD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable See https://unix=2Estackexchange=2Ecom/questions/714338/any-shell-where-expan= sions-are-turned-off-without-escaping-or-quoting https://unix=2Estackexchange=2Ecom/questions/716836/zsh-alias-or-shell-fun= ction-to-only-echo-its-command-line-including-shell-cont https://unix=2Estackexchange=2Ecom/questions/731845/how-to-write-a-functio= n-that-takes-an-argument-string-that-does-not-need-to-be-q For some possible avenues=2E On 4 January 2024 18:09:57 GMT, "Sam B=2E" wrote: >Hello, > >I'm looking for a way to disable most shell expansion for the arguments t= o a script or function and treat everything up to a newline char as verbati= m text, i=2Ee=2E as if quoted=2E > >For example, given a function/script "todo", I'd like > > todo Text inc=2E $var, *glob?, events!, (sub) & more > >to behave more like it was quoted: > > todo 'Text inc=2E $var, *glob?, events!, (sub) & more' > >I know of noglob to disable glob chars, and can have a look at histchars = to see if events can be disabled=2E But I'm not sure if any of the other ex= pansion can possibly disabled=2E > >Mostly I'm interested joting down some plain text which could include '?!= &' and have "todo" receive it all without the shell having done some magic = beforehand=2E > >Any ideas? ------PYU4A13XW947V4FWFFP9QV7EB8O5AD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On 4 January 2024 18:09:57 GMT, "Sam B=2E" <me@rmz=2Eio> wr= ote:
Hello,

I'm looking for a wa= y to disable most shell expansion for the arguments to a script or function= and treat everything up to a newline char as verbatim text, i=2Ee=2E as if= quoted=2E

For example, given a function/script "todo", I'd like
=
todo Text inc=2E $var, *glob?, events!, <redirs, >(sub) &= more

to behave more like it was quoted:

todo 'Text inc= =2E $var, *glob?, events!, <redirs, >(sub) & more'

I know = of noglob to disable glob chars, and can have a look at histchars to see if= events can be disabled=2E But I'm not sure if any of the other expansion c= an possibly disabled=2E

Mostly I'm interested joting down some plain= text which could include '?!&' and have "todo" receive it all without = the shell having done some magic beforehand=2E

Any ideas?
<= /pre>
------PYU4A13XW947V4FWFFP9QV7EB8O5AD--