On Sunday, May 3, 2020 at 4:48:49 PM UTC-7, Michael Orlitzky wrote:
>
> On 5/2/20 1:55 PM, John H Palmieri wrote: 
> > 
> > OMG, why does "sage -grep" use the "find" command? 
> > 
>
> Others have pointed out that "-r" isn't standard, but "-r" is wrong 
> anyway. It's only supposed to search through python files. And having 
> "find" look for those files isn't any slower than having grep do it -- 
> that's why "-r" isn't a standard flag, it's redundant. 
>
> But your OMG is justified for another reason, 
>
>  find sage -print | GREP_OPTIONS= egrep '.py([xdi])?$' | xargs grep "$@" 
>
 

> is calling egrep on the output to find the files with pythonic 
> extensions, when "find -name" exists to do just that. Also, a pointless 
> use of xargs. Here's what it should be: 
>
>   find ./ \( -name '*.py' \ 
>              -o -name '*.pyx' \ 
>              -o -name '*.pyd' \ 
>              -o -name '*.pyi' \) \ 
>           -exec grep "$@" {} + 
>
> That's all POSIX and can be run with /bin/sh and not /bin/bash. 
>


And to clarify, this is what you expect users to use instead of 
search_src?  ;)

 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/53db82ce-edd9-40f8-adf7-f58958f54f44%40googlegroups.com.

Reply via email to