On Sat, Apr 29, 2023 at 1:53 PM Chris Adams <li...@cmadams.net> wrote:

> Once upon a time, Patrick O'Callaghan <pocallag...@gmail.com> said:
> > On Sat, 2023-04-29 at 10:23 -0400, Tom Horsley wrote:
> > > I'd wager there are shell scripts using fgrep that were written on
> > > the first pdp-11 unix and are still in use today
> >
> > IIRC early PDP-11 UNIX (pre System V) only had grep. fgrep and egrep
> > are later additions. (Not trying to counter your argument).
>
> The warning (and presumably eventual removal) of egrep/fgrep is really
> pretty dumb.  In most cases, the idea of removing deprecated
> functionality is to remove stale code and/or reduce code complexity.
> But there's zero benefit to removing egrep/fgrep, since the
> functionality will still be there (as grep -E and grep -F), and the
> "complexity" of each is a one-liner shell script (arguably, this could
> just be a couple of lines in grep to detect argv[0] and use symlinks).
>

My career was in scientific research, where many subject niches are pursued
by a relatively few people work in a particular topic and are spread around
the
globe.  Many of these niche areas rely on software with unix in the
pedigree,
a combination of shell scripts and Fortran programs, and are now used with
different linux distros and POSIX-like environments (Mysy2 or Cygwin in
Windows)
or macOS.

Users working for large enterprises or government agencies generally have
no
choice of OS.  Few of these users are well-versed in linux (and have never
heard of POSIX).   Many are contributing bug fixes or adding capabilities
and
sharing those with the community.   When macOS replaced bash with zsh and
some linux distros started using dash for instead of bash for /bin/sh, there
was a shift to remove bashisms from shell scripts, or to replace
problematic shell
scripts with Python scripts.  An example of the later is
[NASA's OCSSW Processing System](
https://oceancolor.gsfc.nasa.gov/docs/ocssw/index.html).

When running commands, egrep and fgrep are easier/shorter to type than
> grep -E and grep -F (espcially since the options are capitalized).  I
> can easily work around the stupidity by just making egrep/fgrep shell
> aliases instead, bypassing the warning for interactive use, but that
> doesn't make it any less dumb.
>

This is fine for personal use, but as soon as you start sharing script with
a
diverse community, using the extra 3 characters can save a lot of time and
confusion.

There is absolutely zero demonstrable benefit to this warning (and
> eventual removal), except to break old scripts and old typing habits.
>

You are thinking in terms of personal use.  These days, linux is used to
develop software that will be used on other platforms.  Changes like the
removal of [ef]grep are helpful with scripts that will be used in Cygwin,
Msys2,
and macOS (BSD) environments.   There are other approaches.  For bash there
are bashism detection scripts.  It might have been better to provide
additional
portability warning tools, but them as writes the programs gets to choose
the
approach.

-- 
George N. White III
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to