shelljs / shelljs/shx

sed should be silent if '-i' is provided

Open
#159 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking fix sed
Dominant language
JavaScript
Stars
1.9k
Forks
51
Avg merge
3d 2h
Merged PRs (30d)
1

Description

$ sed -i 's/foo/bar/g' file.txt # note: this is silent
$ cat file.txt
bar
$ shx sed -i 's/bar/baz/g' file.txt # this should be silent
baz
$ shx cat file.txt
baz

We could arguably make the change in shelljs itself (which would help n_shell).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how shx sed handles the -i option, then compare whether the behavior belongs in shx or shelljs, including the mentioned n_shell path. Reproduce the commands from the issue and verify that sed -i produces no extra output while still updating file.txt.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.