I am having this controversial commentary on this answer to a quesion whether we should use fgrep or grep with the -F
switch (i.e grep -F
) for portability. The points that have been came into light so far are:
grep -F
:
- Is a POSIX Standard.
- GNU
grep
has declaredfgrep
to be deprecated.
fgrep
:
- Historically it came before the
grep -F
option. - Even though GNU grep declared
fgrep
to be deprecated, they seem to stick with it for it's historical use.
If you consider old (really old) systems, then probably you can find some of them not having the grep -F
in them (and I think the chance of it happening is very rare). But do we really need to worry about those very very old machines and avoid POSIX standard for that!!
If you think about the current situation and include those old machines (which supposedly/allegedly doesn't have grep -F
), then the systems supporting fgrep
will be more.
On the other hand, if you look into the future, fgrep
is going to be a history and grep -F
will triumph upon it as a POXIS standard.
And moreover isn't it a general knowledge now, to use POSIX standard for better portability?