-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grep: implement -Bn and -Cn #811
Merged
Merged
Conversation
This file contains 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
Contributor
mknos
commented
Nov 14, 2024
- For -B, context lines before a matching line are saved in a buffer and emptied when a match occurs
- -C can then be added with no extra logic as a shortcut for -A and -B
- The old meaning of -C goes away, but I'm not aware of any other version of grep that had that special count feature
- To test, I modified the file "ar" so it has two consecutive lines matching "this"
* For -B, context lines before a matching line are saved in a buffer and emptied when a match occurs * -C can then be added with no extra logic as a shortcut for -A and -B * The old meaning of -C goes away, but I'm not aware of any other version of grep that had that special count feature * To test, I modified the file "ar" so it has two consecutive lines matching "this" %perl grep -n -C 5 this ar 452-on the command line to ``select'' archive files for an operation, only 453-the first file with a matching name will be selected. 454- 455-The normal use of ar is for the creation and maintenance of libraries 456-suitable for use with the loader (see ld(1)) although it is not 457:this is good 458:restricted to this purpose. 459- 460-=head2 OPTIONS 461- 462-I<ar> accepts the following options: 463- -- 571-Extract the specified archive members into the files named by the 572-command line arguments. If no members are specified, all the 573-owner and group will be unchanged. The file access and modifica- 574-tion times are the time of the extraction (but see the -B<o> op- 575-tion). The file permissions will be set to those of the file 576:when it was entered into the archive; this will fail if the user 577-is not the owner of the extracted file or the super-user. 578- 579-=back 580- 581-I<ar> exits 0 on success, and >0 if an error occurs. -- 596-=head1 COPYRIGHT and LICENSE 597- 598-This program is copyright by dkulp 1999. 599- 600-This program is free and open software. You may use, copy, modify, distribute 601:and sell this program (and any modified variants) in any way you wish, 602-provided you do not restrict others to do the same. 603- 604-=cut 605- %perl grep -n -C 1 this ar 456-suitable for use with the loader (see ld(1)) although it is not 457:this is good 458:restricted to this purpose. 459- -- 575-tion). The file permissions will be set to those of the file 576:when it was entered into the archive; this will fail if the user 577-is not the owner of the extracted file or the super-user. -- 600-This program is free and open software. You may use, copy, modify, distribute 601:and sell this program (and any modified variants) in any way you wish, 602-provided you do not restrict others to do the same. --
github-actions
bot
added
Type: enhancement
improve a feature that already exists
Priority: low
get to this whenever
Program: grep
The grep program
labels
Nov 14, 2024
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:26 — with
GitHub Actions
Inactive
mknos
temporarily deployed
to
automated_testing
November 14, 2024 06:27 — with
GitHub Actions
Inactive
Pull Request Test Coverage Report for Build 11831906132Details
💛 - Coveralls |
briandfoy
approved these changes
Nov 14, 2024
briandfoy
added
Status: accepted
The fix is accepted
and removed
Priority: low
get to this whenever
labels
Nov 14, 2024
briandfoy
added
Status: released
there is a new release with this fix
and removed
Status: accepted
The fix is accepted
labels
Dec 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Program: grep
The grep program
Status: released
there is a new release with this fix
Type: compatability
make it work like GNU or BSD
Type: enhancement
improve a feature that already exists
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.