zsh-workers
 help / color / mirror / code / Atom feed
* `repeat` with special characters - "bad math expression: illegal character"
@ 2021-01-23 18:11 Patrick Reader
  2021-01-23 19:33 ` Lawrence Velázquez
  2021-01-23 20:47 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Reader @ 2021-01-23 18:11 UTC (permalink / raw)
  To: zsh-workers

Hi,

When I use the `repeat` complex command with an arithmetic expression 
containing one of the following special characters:

* = ^ ?

I get an error message in the form "zsh: bad math expression: illegal 
character: \M-X". The "X" is replaced by one of G M F W (corresponding 
to the symbols above). This doesn't happen if I wrap the character in 
single or double quotes, or escape it with a backslash. It still happens 
with even the options `noglob`, `noequals`, `nomagicequalsubst` which I 
thought might be causing them to be misinterpreted.

Why does this happen?

Patrick



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

* Re: `repeat` with special characters - "bad math expression: illegal character"
  2021-01-23 18:11 `repeat` with special characters - "bad math expression: illegal character" Patrick Reader
@ 2021-01-23 19:33 ` Lawrence Velázquez
       [not found]   ` <0102017730be053e-9eccbdb4-1596-4ae7-8bee-5f2005229b83-000000@eu-west-1.amazonses.com>
  2021-01-23 20:47 ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Lawrence Velázquez @ 2021-01-23 19:33 UTC (permalink / raw)
  To: Patrick Reader; +Cc: zsh-workers

> On Jan 23, 2021, at 1:11 PM, Patrick Reader <_@pxeger.com> wrote:
> 
> Hi,
> 
> When I use the `repeat` complex command with an arithmetic expression containing one of the following special characters:
> 
> * = ^ ?
> 
> I get an error message in the form "zsh: bad math expression: illegal character: \M-X". The "X" is replaced by one of G M F W (corresponding to the symbols above). This doesn't happen if I wrap the character in single or double quotes, or escape it with a backslash. It still happens with even the options `noglob`, `noequals`, `nomagicequalsubst` which I thought might be causing them to be misinterpreted.
> 
> Why does this happen?

Could you provide an example?

vq

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

* Re: `repeat` with special characters - "bad math expression: illegal character"
       [not found]   ` <0102017730be053e-9eccbdb4-1596-4ae7-8bee-5f2005229b83-000000@eu-west-1.amazonses.com>
@ 2021-01-23 19:41     ` Lawrence Velázquez
  0 siblings, 0 replies; 4+ messages in thread
From: Lawrence Velázquez @ 2021-01-23 19:41 UTC (permalink / raw)
  To: Patrick Reader; +Cc: zsh-workers

> On Jan 23, 2021, at 2:34 PM, Patrick Reader <_@pxeger.com> wrote:
> 
>> Could you provide an example?
> 
> Compare
> 
> repeat 2*3 echo six
> 
> vs.
> 
> repeat "2*3" echo six
> 
> or
> 
> repeat '2*3' echo six
> 
> or
> 
> repeat 2\*3 echo six
> 
> or
> 
> repeat 6 echo six

I don't know why you didn't send this to the list.

vq


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

* Re: `repeat` with special characters - "bad math expression: illegal character"
  2021-01-23 18:11 `repeat` with special characters - "bad math expression: illegal character" Patrick Reader
  2021-01-23 19:33 ` Lawrence Velázquez
@ 2021-01-23 20:47 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2021-01-23 20:47 UTC (permalink / raw)
  To: Patrick Reader; +Cc: zsh-workers

On Sat, Jan 23, 2021 at 10:11 AM Patrick Reader <_@pxeger.com> wrote:
>
> When I use the `repeat` complex command with an arithmetic expression
> containing one of the following special characters: [...]
> I get an error message in the form "zsh: bad math expression: illegal
> character: \M-X".

Fixed last March:

commit 2a9674862ecaf9b7b1b66178782d47e8445df325
Author: Peter Stephenson <p.w.stephenson@ntlworld.com>
Date:   Thu Mar 26 20:54:37 2020 +0000

    45616: Remove token from count argument to repeat


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

end of thread, other threads:[~2021-01-23 20:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-23 18:11 `repeat` with special characters - "bad math expression: illegal character" Patrick Reader
2021-01-23 19:33 ` Lawrence Velázquez
     [not found]   ` <0102017730be053e-9eccbdb4-1596-4ae7-8bee-5f2005229b83-000000@eu-west-1.amazonses.com>
2021-01-23 19:41     ` Lawrence Velázquez
2021-01-23 20:47 ` 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).