Fix Unix Problem In Search
Problem
Under Solaris, grep hangs when given the
-- option before the list of files to search.
Enhancement Request
Add a configuration variable in
TWiki.cfg, say
$grepswitch, which allows a user to define out the use of the
-- switch. Otherwise, one has to modify
lib/TWiki/Search.pm manually, which is a less desirable way of customizing the system.
For example, add to TWiki.cfg at the end of the customization section
# For some systems, set to ""
$grepswitch = "--"
and then change the lines in
lib/TWiki/Search.pm which assemble the grep command to reference
${TWiki::grepswitch}.
--
ThomasWeigert - 03 Jan 2004
is this with sun's grep or gnu's?
--
WillNorris - 03 Jan 2004
With both. It's funny, when you run the grep from the command line, the
-- do no harm. But when run from TWiki, the system hangs. Removing the
-- from the query fixes the hang, and does not seem to cause any problems...
--
ThomasWeigert - 05 Jan 2004
I think this problem needs more investigation - try logging the exact command used by TWiki and re-running it as the same userid. It could be that an older grep is being used by the TWiki/Apache userid, and this is missing the '--' option.
It's advisable to use only GNU grep, as recommended on
TWikiOnSolaris, and to ensure that this is used by the TWiki scripts (put a full path in the TWiki.cfg setting if necessary).
The
HTML output of
testenv would be very useful - if this doesn't say that GNU grep is used, you have a problem anyway.
--
RichardDonkin - 06 Jan 2004