#3244 PR merged: Replace obsolete egrep with grep -E

Labels: cleanup, fixed / solved / done

lzaoral opened issue at 2024-06-12 07:39:

Pull Request Details:
  • Type: Bug Fix

  • Impact: Normal

  • Description of the changes in this pull request:

Replace obsolete egrep with grep -E to fix the following warning from GNU grep

$ egrep ...
egrep: warning: egrep is obsolescent; using grep -E
...

present in the rear mkbackup logs in Testing Farm.

Related: https://www.shellcheck.net/wiki/SC2196
Related: https://artifacts.dev.testing-farm.io/c02f01a7-83d0-4187-b69e-91dc043a457a/work-backup-and-restorez5wihv38/tests/plans/backup-and-restore/execute/data/guest/default-0/make-backup-and-restore-iso-1/data/rear-mkbackup.log

jsmeix commented at 2024-06-12 11:33:

@lzaoral
out of curiosity:
Did you do the replacements manually at each place
or did you use some tool (like 'sed') to automate it?

I ask because at some places the replacement is like
egrep -xyz -> grep -Exyz
while at other places the replacement is like
egrep -xyz -> grep -E -xyz
so it looks a bit inconsistent which indicates
you did it manually.

Wouldn't an automated replacement like
'egrep ' -> 'grep -E ' (note the trailing space)
have been always right - or are there exceptions?

jsmeix commented at 2024-06-14 04:47:

@rear/contributors
unless there are objections
I will merge it today afternoon.

jsmeix commented at 2024-06-14 11:58:

@lzaoral
thank you for this code cleanup work!

By the way:
I know that 'egrep' is deprecated "since the beginning of time"
so I guess 'egrep' will stay there in this or that form
"until end of time".
But that warning is an annoyance, cf.
https://schlomo.schapiro.org/2015/04/warning-is-waste-of-my-time.html
so it is good to get rid of it.


[Export of Github issue for rear/rear.]