FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(sed): avoid extra newline when joining multiple files by Hashim1999164 · Pull Request #1261 · shelljs/shelljs · GitHub

fix(sed): avoid extra newline when joining multiple files - #1261

Open
Hashim1999164 wants to merge 1 commit into
shelljs:mainfrom
Hashim1999164:fix/sed-multi-file-double-newline
Open

fix(sed): avoid extra newline when joining multiple files#1261
Hashim1999164 wants to merge 1 commit into
shelljs:mainfrom
Hashim1999164:fix/sed-multi-file-double-newline

Conversation

Hashim1999164 commented Jul 22, 2026
edited
Loading

Copy link
Copy Markdown

Summary

  • sed was joining multi-file results with an extra newline, so files that already ended with \n produced a blank line between them (hello1\n\nhello2\n).
  • Join file outputs directly, matching unix sed/cat concatenation.
  • Update multi-file tests and add a regression covering trailing-newline inputs.

Fixes #1068

Test plan

  • npx ava test/sed.js
  • Manual check: sed on file1.txt + file2.txt yields hello1\nhello2\n (not a double newline)

Concatenating sed results with an extra newline inserted a blank line
between files that already ended with a newline. Match unix sed/cat by
joining file outputs directly.

Fixes shelljs#1068.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected double newline in shell.sed() output

1 participant


Back | FazBrowse Home | New Git URL