Skip to content

cmds/core/grep: fix line number (-n)#2658

Merged
binjip978 merged 2 commits intou-root:mainfrom
binjip978:fix-grep-number
Apr 20, 2023
Merged

cmds/core/grep: fix line number (-n)#2658
binjip978 merged 2 commits intou-root:mainfrom
binjip978:fix-grep-number

Conversation

@binjip978
Copy link
Copy Markdown
Contributor

From POSIX: Precede each output line by its relative line number in the file, each file starting at line 1.

From POSIX: Precede each output line by its relative line
number in the file, each file starting at line 1.

Signed-off-by: Siarhiej Siemianczuk <[email protected]>
@binjip978 binjip978 added the Awaiting reviewer Waiting for a reviewer. label Apr 18, 2023
@10000TB
Copy link
Copy Markdown
Member

10000TB commented Apr 20, 2023

you are right

xuehaohu@worldpeace:~$ grep -n -ir "haha" tee.txt
2:haha
4:haha
xuehaohu@worldpeace:~$ cat tee.txt
adadad
haha
ttt
haha
xuehaohu@worldpeace:~$ grep -ir "haha" tee.txt
haha
haha

@binjip978 binjip978 merged commit 974cc0c into u-root:main Apr 20, 2023
@binjip978 binjip978 deleted the fix-grep-number branch April 20, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting reviewer Waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants