#609

sed: -i.bak makes no backup, one-line a\text keeps the backslash, \U prints a literal U

Openasafyishopened 14d ago

just-bash version

3.6.0

Reproduction

cd /w
sed -i.bak 's/a/A/' s.txt; test -f s.txt.bak && echo backup || echo "no backup"
printf 'one\ntwo\n' | sed '1a\added'
echo hello | sed 's/hello/\U&/'

How you run it

import { Bash } from "just-bash";

const bash = new Bash({ files: { "/w/s.txt": "a\nb\n" } });
const result = await bash.exec(script);

Expected behavior

GNU sed:

backup
one
added
two
HELLO

Actual behavior

no backup
one
\added
two
Uhello

s.txt itself is edited correctly; only the backup is missing. The one-line a\text form keeps its backslash, and \U comes out as a literal U.

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.