zsh-users
 help / color / mirror / code / Atom feed
* How to efficiently allow * in a cml string
@ 2021-11-24  5:06 jdh
  2021-11-26  5:46 ` Lawrence Velázquez
  0 siblings, 1 reply; 2+ messages in thread
From: jdh @ 2021-11-24  5:06 UTC (permalink / raw)
  To: zsh-users



I don't fancy the idea of always using a backslash * to escape the asterisk for a simple script I wrote and one which will never use the * as a wildcard character.

For now I'm using a '@' in it's stead and doing a :gs/@/* to change the @'s into *'.

But, I really want to use the * as is and not have to use @ and then convert it.

Is there some way the invoiked script can reach into the buffer before zsh complains about the *.


I've tried:  'unsetop GLOB' but that didn't work.


Simple example: How can I get a script to do 2*4 in the below simple version:

	$  calculate  2*4


Thanks.


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

* Re: How to efficiently allow * in a cml string
  2021-11-24  5:06 How to efficiently allow * in a cml string jdh
@ 2021-11-26  5:46 ` Lawrence Velázquez
  0 siblings, 0 replies; 2+ messages in thread
From: Lawrence Velázquez @ 2021-11-26  5:46 UTC (permalink / raw)
  To: jdh; +Cc: zsh-users

On Wed, Nov 24, 2021, at 12:06 AM, jdh wrote:
> Is there some way the invoiked script can reach into the buffer before 
> zsh complains about the *.
>
> I've tried:  'unsetop GLOB' but that didn't work.

Well yeah, filename expansion happens before the script executes.

> Simple example: How can I get a script to do 2*4 in the below simple version:
>
> 	$  calculate  2*4

Presumably you won't be satisfied with

    calculate '2*4'

or

    noglob calculate 2*4

You may want to read through this thread beginning with users/27103,
which already covered a lot of the same ground.

https://www.zsh.org/mla/users/2021/msg00815.html

-- 
vq


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

end of thread, other threads:[~2021-11-26  5:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  5:06 How to efficiently allow * in a cml string jdh
2021-11-26  5:46 ` Lawrence Velázquez

Code repositories for project(s) associated with this 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).