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

Re: Deprecation of egrep



> 2022/09/12 18:08, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> 
> May I suggest naming the function something else?  «egrep foo»
> should interpret foo as an extended regular expression; this function
> doesn't.

Yes; I just wanted to patch only single file.
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.

> As to propagating configure's EGREP to ztst.zsh: propagating a single
> variable should be straightforward enough, but what about cross builds?

Hmm, then, if we _know_ the system(s) on which 'grep -E' does not work
we can define EGREP in ztst.zsh depending on $OSTYPE. But I feel this
is not a good idea.



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