#608

awk: bare length pattern, ^, zero-padded printf and print > "/dev/stderr" give wrong output

Openasafyishopened 14d ago

just-bash version

3.6.0

Reproduction

printf 'abc\nabcdef\n' | awk 'length > 4'
echo '3 4' | awk '{ print $1 ^ $2 }'
awk 'BEGIN { printf "%05.1f|\n", 3.14159 }'
awk 'BEGIN { print "e" > "/dev/stderr" }'

How you run it

import { Bash } from "just-bash";

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

Expected behavior

awk (one-true-awk and gawk agree):

abcdef
81
003.1|

The last line, e, goes to stderr.

Actual behavior

3
  3.1|

and nothing on stderr. All four commands exit 0. In order:

  • the bare length pattern selects nothing;
  • ^ doesn't exponentiate;
  • the 0 flag doesn't zero-pad;
  • print > "/dev/stderr" output disappears.

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.