Tracker Grep

Version 3.2
Released on Saturday, 25 November 2000

Created by Matthijs Hollemans
mahlzeit@bigfoot.com
http://www.weirdexperiments.com
http://home.concepts.nl/~hollies

What is it
Tracker Grep is a simple Tracker add-on that I knocked up in a couple of hours because I got tired of going into a Terminal every time I wanted to do a grep. For those of you in the unknown, grep is a very handy command-line tool that searches text files for lines that match a given pattern. Gone are those days of command-line trouble, because from now on Tracker Grep lets you run grep directly from the Tracker.

How to install it
Double-click the Installer icon to launch the installation program. The Installer will automatically put the file Tracker Grep-G into the /boot/home/config/add-ons/Tracker/ folder. (The -G suffix on the filename indicates the keyboard shortcut that you can use to launch Tracker Grep).

How to get rid of it
Double-click the Uninstaller icon to launch the uninstallation program. The Uninstaller will automatically remove Tracker Grep from your system.

How to use it
Tracker Grep is no more than a graphical front-end to the grep tool that comes with the BeOS. In the past you needed to know how grep worked in order to use Tracker Grep. As of version 3.0 this is no longer the case, although grep addicts are still catered for. For full details on grep, see the BeOS Shell Tools Documentation for more information.

Select the files that you want to examine. Then right-click on one of the files or open the File menu of the Tracker. Go to Add-Ons and choose Tracker Grep. Alternatively you can press the keys Right Ctrl-Alt-G (PC keyboard) or Command-Control-G (Macintosh keyboard). If you don't select any files at all, Tracker Grep will look at all the files in the current directory.

In addition to that, you can tell Tracker Grep to look into sub-directories and follow symbolic links as well. But if you do, then be aware that some of your links may be circular (they indirectly point at each other) which causes the search to loop forever if you don't cancel it at some point.

Because grep was meant to examine text files, Tracker Grep will only work on files that have the MIME supertype text or message. Normally this is true for all your text files, HTML files, e-mail messages, source code files and so on. If a file has another MIME type (or none at all), it will be ignored.

During the search, the Tracker Grep window displays the names of the files whose contents match the search pattern. You can click on the little arrow to the left of a file's name to either view or hide its matching lines. The Show contents check box tells Tracker Grep to automatically expand or collapse the contents of all files.

And last, but not least, you can open a file by double-clicking its name or one of its matching lines.

For advanced users of grep: By default, Tracker Grep escapes the search text before it is given to grep. If you want to use grep's full power, turn on the Do not escape search text item in the Options menu. If this option is enabled, the search pattern is literally transferred to grep. This also allows you to pass any other command line options to grep, simply by typing them in the search text input field. Remember that grep runs inside the shell, so you still may have to escape characters that have a special meaning to the shell, most notably the backslash.

Known problems

  • With the Do not escape search text option turned on, entering certain search patterns may have unexpected results. A search pattern like /* appears to hang the machine. Tracker Grep (and the system in general) becomes unresponsive, because the grepper thread is working like crazy. The same thing happens when you enter grep /* filename in the Terminal (you probably should have typed \\/*).

  • The user interface of Tracker Grep becomes a little sluggish when a search turns up a lot of matches per file.

Legal stuff
This version of Tracker Grep is public domain, so you may do anything you like with it. It comes with full source for those with enquiring minds. No warranties expressed or implied. I am not responsible for whatever may happen to whomever, whenever.

Thanks to Peter Hinely, Serge Fantino, and Hideki Naito for their help on previous versions, and to everyone that mailed me with bug reports and feature requests. Your feedback is warmly appreciated!

History
Version 1.0.0 (Saturday, 4 July 1998)

  • First version.
Version 1.1.0 (Not released)
  • Tracker Grep now looks at all the files in the current directory if nothing is selected.
  • Files may also have MIME supertype "message".
Version 2.0.0 (Friday, 31 July 1998)
  • This is a total rewrite (hence the major version number bump).
  • The user interface has been improved (and is more responsive).
  • Added a button to start and cancel the search.
  • The results display now uses a fixed-width font.
  • Added an option for subdirectory crawling.
  • Added an option for traversing symbolic links.
Version 2.1.0 (Monday, 24 August 1998)
  • Changes by Peter Hinely (phinely@hawaii.edu) include:
    • Ported to ppc.
    • Changed grep options to "grep -hin".
    • Improved display of matches.
Version 2.1.1 (Tuesday, 12 January 1999)
  • Ported to BeOS Intel R4. The PowerPC version is unchanged.
Version 2.2.0 (Saturday, 23 January 1999)
  • Changes by Serge Fantino (fantino@math.unice.fr) include:
    • Now you can run multiple copies of Tracker Grep at the same time without crashing the machine :-)
    • Only the files whose contents match the search pattern are displayed.
    • The results are now displayed in an outline list.
    • Double-clicking the name of a matching file opens that file.
  • Added the "Show Contents" option.
  • The window shows the name of the file that is being searched.
  • Tracker Grep remembers its most recent settings.
Version 3.0 (Sunday, 24 September 2000)
  • Cleaned up the source code.
  • There is no more PowerPC version.
  • The "Show contents" check box is not disabled any more during a search, so you can toggle it on-the-fly.
  • Moved the other options into a separate "Options" menu.
  • Added an option for case sensitive searches.
  • By default, Tracker Grep now escapes special characters in the search text before it is sent to grep. For advanced users of grep, there is a "Do not escape search text" option.
  • Tracker Grep now keeps a history of the last twenty-or-so search patterns.
  • Non-printable characters (such as linefeeds) are removed from the search results.
  • Tracker Grep no longer crashes when grep is given an invalid search pattern, taking the Tracker with it.
Version 3.1 (Wednesday, 11 October 2000)
  • When replacing non-printable characters, Tracker Grep was a little bit too enthousiastic and wiped out characters from non-Latin languages (such as Japanese) as well. Thanks to Hideki Naito (www.wickedbeat.com) for finding - and fixing - this bug.
Version 3.2 (Saturday, 25 November 2000)
  • Now the Tracker Grep window is named after what directory the user is searching in.
  • Reversed the order of the items in the history pop-up menu. It now shows the things you last searched for at the top, since that makes more sense.