Skip to content

[Known Issue] grep/egrep has different versions (GNU and BSD as I've encountered), need to support both. #2

@dryruner

Description

@dryruner
  1. On ubuntu:
    $ grep -V;
    grep (GNU grep) 2.16
    ...
    $ egrep -V;
    egrep (GNU grep) 2.16
    ...
  2. On Mac OSX (BSD):
    $ grep -V;
    grep (BSD grep) 2.5.1-FreeBSD
    $ egrep -V;
    egrep (BSD grep) 2.5.1-FreeBSD

** What's the impact?

BSD greps and GNU greps has slightly different functionalities.
GNU grep supports perl-like non greedy match:
grep -P '"objURL":".?"' -o
But it doesn't work with egrep [-P] '"objURL":".
?"' -o (GNU egrep is different from BSD egrep)

BSD egrep supports this by:
egrep '"objURL":".?"' -o
But it doesn't work with grep -P '"objURL":".
?"' -o (BSD grep doesn't support -P)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions