#610

A function called inside $(( )) is 'command not found', and brace expansion silently stops at 10,000 items

Openasafyishopened 14d ago

just-bash version

3.6.0

Reproduction

f() { echo 2; }; echo $(( $(f) + 1 ))
printf '%s\n' {1..20000} | tail -1

How you run it

import { Bash } from "just-bash";

const result = await new Bash().exec(script);

Expected behavior

bash:

3
20000

Actual behavior

1
10000

with bash: f: command not found on stderr.

  • Arithmetic: the command substitution inside $(( )) doesn't see the function.
  • Brace expansion: I'd expect either the full expansion or an execution-limit error like the other limits raise. Cutting it at 10,000 without a word means a for i in {1..N} loop quietly does less work.

Environment

  • Runtime (Node, Bun, browser, CLI): Node
  • Runtime version: 26.8.2
  • Operating system: macOS 15
  • Bundler or framework, when relevant: none

Activity

0

No activity yet.