uutils/sed

rejects address ranges for i and a commands (GNU accepts them)

Open

#248 geöffnet am 11. Jan. 2026

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (23 Forks)github user discovery
good first issue

Repository-Metriken

Stars
 (91 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 9h) (25 gemergte PRs in 30 T)

Beschreibung

Rust (incorrect - returns error)

  $ echo -e "a\nb\nc" | cargo run --quiet -- -e '1,2i\text'
  # Error: sed: <script argument 1>:1:4: error: command i expects up to 1 address(es), found 2
  # Exit code: 1

GNU (correct)

  $ echo -e "a\nb\nc" | /usr/bin/sed -e '1,2i\text'
  # Output:
  # text
  # a
  # text
  # b
  # c
  # Exit code: 0

Additional test case for a (append) command:

Rust (incorrect - returns error)

  $ echo -e "a\nb\nc" | cargo run --quiet -- -e '1,2a\text'
  # Error: sed: <script argument 1>:1:4: error: command a expects up to 1 address(es), found 2
  # Exit code: 1

GNU (correct)


  $ echo -e "a\nb\nc" | /usr/bin/sed -e '1,2a\text'
  # Output:
  # a
  # text
  # b
  # text
  # c
  # Exit code: 0

Bug Found by Fuzzer

Contributor Guide