Tags:
create new tag
, view all tags

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

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2005-02-14 - SamHasler
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.