I have files that are used to install files with specific owner:group and permissions.  I'll ignore permissions for clarity and the details of installing files.  Once an owner & group are set to a specific pair, then I want to print a separator line followed by all subsequent lines until either the owner or group changes.  If I could print the line numbers with the lines, that would be great too.  The pair I'm searching for is owner, group as ownerX, groupY respectively.Example (I don't need line numbers, so I'll leave them off)type = d  owner = root  group = staff      mode = 0750 <-Ignore.  owner & group aren't ownerX & groupY      ...  <- Ignore  group = groupY <- owner=root, not ownerX, so still not ownerX & groupY      ...  <- Ignore  owner = ownerX <-Now, owner=ownerX and group=groupY      <- Print -----------------      mode = 0750             <- Print      target = /app_dir/conf  <- Print       target = /app_dir/data  <- Print  owner = dilbert          <- Stop printing since not ownerX & groupY      ...  <- Ignore  group = Dogbert      ...  <- Ignore  group = groupY      ...  <- Ignore  owner = ownerX      <- Print a separator line      type = f                                                       <- Print      mode = 0540                                                    <- Print      source = [path to compiled binary file in source environment]/file1_ver2  <- Print      target = [path to a bin directory in the install environment]/file  <- Print  owner = oracle <- stop printing  ...  <End of File, EOF>  So, the desired output would be:  ---------  mode = 0750  target = /app_dir/conf  target = /app_dir/data  ---------  type = f  mode = 0540  source = [path to compiled binary file in source environment]/file1_ver2  target = [path to a bin directory in the install environment]/file1  That would help me apply the following fixes:Change the 1st mode from 0750 (group is read-only) to 0770.Change the 2nd mode from 0540 (group can't execute) to 0550.  
How do I list all lines after two subsequent patterns are matched up to when they don't
text processing;sed;awk