Re: [PATCH] common/rc: replace obsolescent egrep and fgrep

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Tue, Sep 13, 2022 at 05:33:45PM +0800, Zorro Lang wrote:
> Due to the change in grep project:
>   a95156247098 ("egrep, fgrep: now obsolete")
> 
> some tests start to fail on latest Fedora system with grep-3.8-1.fc38
> or newer version, as:
> 
>   generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
>   ...
>       @@ -1,4 +1,5 @@
>        QA output created by 447
>       +egrep: warning: egrep is obsolescent; using grep -E
>       ...
> 
> So use grep -E and -F to instead of egrep and fgrep commands.
> 
> Signed-off-by: Zorro Lang <zlang@xxxxxxxxxx>
> ---
>  common/rc | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index a25cbcd0..dee3965e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -30,6 +30,17 @@ dd()
>  	fi
>  }
>  
> +# The egrep and fgrep are obsolescent
> +egrep()
> +{
> +	grep -E "$@"
> +}
> +
> +fgrep()
> +{
> +	grep -F "$@"
> +}

Why not conditionally define these *only* if the system doesn't already
have an egrep/fgrep binary?

(Alternately I guess you could take Murphy's patch, since that's the
proper fix according to the gnu grep maintainers...)

--D

> +
>  # Prints the md5 checksum of a given file
>  _md5_checksum()
>  {
> -- 
> 2.31.1
> 



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux