Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Deprecation of egrep



> On 12/09/2022 11:15 Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> If we are going to patch each file that uses egrep, we can use
> zsh pattern matching in each of them; for example:
> 
> diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst
> index e2e9a25ef..cde3f2b81 100644
> --- a/Test/D07multibyte.ztst
> +++ b/Test/D07multibyte.ztst
> @@ -6,7 +6,7 @@
>    unset -m LC_\*
>    mb_ok=
>    langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
> -	 $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
> +	 ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)} )
>    for LANG in $langs; do
>      if [[ é = ? ]]; then
>        mb_ok=1
> 
> I don't know which is better.

I tend to agree with Bart that a change like the above is probably best
in the long run.  Directly using zsh's own features inline would be
clearer (given the core audience here is zsh experts anyway).

pws




Messages sorted by: Reverse Date, Date, Thread, Author