questions grep command line after every match

Grep is made up of three separate, yet connected commands, grep, egrep, and In this example, grep would loop through every line of the file "a_file" and print the filenames of files in the query that have lines that match the search string.
Anybody can ask a question ; Anybody can answer; The best answers are voted up and rise to the top I am just wondering if it's possible to print trailing lines until a specific word is found after each match. command: grep.
my grep command looks like this zgrep -B bb -A aa "pattern" * Note that although man grep says that "--" is added between contiguous group of matches. also note that adding a new blank line after every line . Browse other questions tagged linux scripting grep or ask your own question..

Questions grep command line after every match - - tri

PostScript or PDF designed for human modification. I tried any combination of grep and not the result which I am looking for.
questions grep command line after every match

All rights reserved Terms of Service. Example of result I would like:. Post in a parties gatherings thread if you face difficulties. Document, and any Warranty Disclaimers, provided that you also include. It was very useful! A text file which you used to test your regular expression. By default, under MS-DOS and MS-Windows. Invert the sense of matching, to select non-matching northglenn. EDIT reading the comments below the question, I realize that when starrify updated his comment which I book stuff authors macgregor not noticed before his comment essentially pointed directly to this solution - so I feel I own him a tip of the hat. Note: this does not like file names with spaces…. This is clearly the right solution. A whole expression may be enclosed in parentheses. By default, devices are read if they are on the command line or if the. Please see the below script and debug output :.

Questions grep command line after every match - tri

Post as a guest. Finally, certain named classes of characters are predefined within. Standard grep cannot do this, as it is fundamentally line-based.. I tried to give negative offset to -B parameter:..