Skip to content

grep: context output omits group separators between files #130

Open

Description

@SichenLiang

When context output continues into another file, uutils grep does not print a group separator before the first group in that file.

printf 'hit\nno\nno\nhit\n' > first
printf 'hit\n' > second
grep -n -C0 hit first second

The current uutils output is:

first:1:hit
--
first:4:hit
second:1:hit

GNU grep 3.12 inserts another separator between the files:

first:1:hit
--
first:4:hit
--
second:1:hit

The same difference appears with -r when matches come from two explicitly named directories. All commands exit 0 with empty stderr. GNU also applies --no-group-separator and --group-separator=STRING across file boundaries.

#24 and #42 concern groups within a single file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions