Paolo Bonzini wrote: > On 03/07/2010 11:59 AM, Jim Meyering wrote: >> I too hesitate to commit to libtool for something so small and optional. >> How about making this feature available only on systems that >> provide working dlopen and shared library support? > > What about moving the "real" Perl grep to /usr/libexec/pgrep and > making /usr/bin/grep exec it? This way, grep could be moved to /bin > while keeping the same absolute path. > > The feature should still be opt-out for people who do not want any > absolute paths in the executable (likely Windows people), but it could > be enabled by default and it would be portable.
"exec" feels like too large and expensive a hammer. I really do like Perl regexps, and would probably use grep's -P option frequently (command-line only, of course) if it were available. For something so fundamental, I feel that we should not make everyone pay a performance penalty (however small) for the sake of portability to losing systems. Besides, we should not make a high-level design sacrifice to accommodate losing systems. This is sort of like gnulib's motto: design for the better API, and find/build a shim that lets losing systems get by. Best to design once, well. Losing systems will eventually catch up -- or disappear.
