shx grep -v adds extra newline
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, shell
- Domain
- cli
Research direction
Reproduce the behavior with the two shx grep command forms in the issue, then compare it with the shown shelljs grep calls. Trace the shx grep entry point and verify that both positive and -v filtering end with only the expected single newline.
Written by the indexing model from the issue text.
Description
Certain uses of grep appear to add extra newlines.
Ex:
Try something like this:
shx ls '~/Music/iTunes' | shx grep 'iTunes'
It acts as expected, producing strings with a single \n for each line.
But
shx ls '~/Music/iTunes' | shx grep '-v' 'iTunes'
appears to add a second newline at the end of the set of strings.
This can be explicitly seen in node:
var sh = require('shelljs')
// terminates with a single newline
sh.ls('~/Music/iTunes').grep('iTunes')
// terminates with two newlines
sh.ls('~/Music/iTunes').grep('-v', 'iTunes')
- Dominant language
- JavaScript
- Stars
- 1.9k
- Forks
- 52
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from shelljs/shx
-
fix Windows
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Windows
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
dependencies
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
low priority sed
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·