Skip to Content
Skip to Table of Contents

← Previous Article Next Article →

ATPM 8.06
June 2002

Columns

Segments

How To

Extras

Reviews

Download ATPM 8.06

Choose a format:

Review: AquaGrep 1.0

by Eric Blair, eblair@atpm.com

rotten

Developer: publicspace.net

Price: $9.95

Requirements: Mac OS X 10.0.1

Trial: Fully-featured (10 launches)

Thanks to the Unix underpinnings of Mac OS X, Mac users now have access to some powerful Unix utilities that can simplify many tasks. However, many of these utilities are command-line tools that are used via Terminal.app, and a large number of Mac users find the very idea of a command line disgusting. Fortunately, some enterprising developers have thought to put graphical user interfaces on top of these command-line tools.

AquaGrep is one of these graphical “wrappers.” As the name would suggest, it provides a user interface for the grep utility. grep is a program that allows users to search the content of text files for either a string or a regular expression. Although cryptic, regular expressions can be very powerful things which let you specify different search patterns. For instance, you might use something like [a-zA-Z0-9]*@[a-zA-Z0-9]*\.[a-zA-Z0-9]* to search for e-mail addresses.

The sequence ‘[a-zA-Z0-9]’ represents any character in the ranges of a-z, A-Z, and 0-9. Using the ‘*’ character indicates that the search should find 0 or more of the specified characters. ‘\.’ signifies the ‘.’ character. There are many other, more complex patterns which can be used for specifying regular expressions; unfortunately, AquaGrep supplies no documentation going into detail on any of these patterns. This basically eliminates AquaGrep as a utility that grep novices can use as a learning tool.

aquagrep

That said, AquaGrep is fairly easy to use. You type your search pattern into the Search Term field and you enter the pathname to a file into the File Input field. You can then specify up to six options using checkboxes: ignore case, use regular expressions, find non-matching items, count the number of matching lines, show the line numbers for the matches, and search directories. Clicking OK runs the search and displays the results in the Output area. If you want, you can save the search results to a text file.

AquaGrep’s ease of use is not a result of good design; it is due to the fact that the program does not really do that much. First, it can only search files or directories. The grep utility on the other hand, like other command-line tools, can accept input from another program using the pipes (‘|’). For instance, the following commands would let you determine the current issue of ATPM: curl http://www.atpm.com | grep “Issue [0-9]\.[0-9]*”. The curl command downloads the ATPM homepage from the Web, and the pipe feeds it into the grep program. Since AquaGrep only operates on files and folders, you cannot perform operations like this within the program.

User interface glitches in AquaGrep are plentiful. If you resize the AquaGrep window, the Options box does not change size accordingly. If you enlarge the window, the box does not stretch to fill the new area. This is not a big problem. The problem occurs when you shrink the window. This cuts off the right edge of the box and hides the “recursive through directories” option.

Closing the window can cause problems as well. The Close command has been removed from the File menu and the standard Command-W shortcut does not do anything. However, you can still close the window by clicking the close box. This does not quit AquaGrep, though. Furthermore, once a window is closed, there does not appear to be a way to re-open it without quitting and re-launching AquaGrep. There are several ways the developer could get around this issue—making it so that the window does not close, or so that closing the window closes the program are two options that come to mind—but neither of these options were implemented in AquaGrep.

The user interface does not take into account mutually exclusive options. For instance, if “count lines only” is checked as an option, “show line numbers” has no effect. As a result, this checkbox should be disabled; this however does not happen.

User interface errors are not limited to the main window, as there are also a number of errors in the menus. First, the AquaGrep menu says “Hide NewApplication” instead of “Hide AquaGrep.” This error is repeated in the Help menu, where the menu item says “NewApplication Help.” Additionally, instead of displaying help for AquaGrep, choosing the latter menu item displays an error that “Help isn’t available for AquaGrep.” Since there is no documentation, there is really no reason for this menu to be shown in the application. The final menu error, and while a bit of a nit pick it is consistent with the level of AquaGrep’s quality, is a menu separator that was left underneath the final File menu item.

Another, more glaring, problem is how AquaGrep handles spaces in file names. In short, it does not. This is because the Unix shell sees spaces as the end of file names. The solution to this is to either wrap the file name in quotes or to escape the space character with a backslash (‘\ ’). The purpose of a GUI wrapper should be to simplify access to a command-line utility; for this reason, AquaGrep should perform the necessary modifications to a file name to take spaces into account.

Spaces, though, are not the only characters that can cause problems in file names. AquaGrep also does not handle the pipe (‘|’) or semicolon (‘;’) characters. Using a pipe, somebody could send the output from AquaGrep to another program. Not handling the semicolon is a larger problem. This basically allows a user to run any command from AquaGrep. For instance, ~/Readmetxt; cd ~; rm -r *.* would search the file Readme.txt, then attempt to delete the contents of the user’s home directory. A GUI wrapper for a command-line application should take steps to prevent users from running other commands. AquaGrep fails in this regard. The problem is compounded because simply choosing a file with a problematic path from the open panel can cause an arbitrary command to be executed. In this respect, it’s more dangerous than the command-line, which would either protect the special characters for you (if you use auto-completion) or force you to type the dangerous commands yourself (which it’s hard to do by accident).

Although AquaGrep can search through directories, you cannot select a directory using the Open File dialog. Your only options are to type in the path by hand or to select a file in the directory and then modify the path. One workaround would be to drag and drop a directory onto the AquaGrep window, if AquaGrep supported drag and drop, that is.

One more user interface error that I found in AquaGrep. When you select the About AquaGrep… option, it lists AquaGrep’s price as $7.95. According to AquaGrep’s Web site, though, it costs $9.95.

My final gripe about AquaGrep is that it creates a file that contains the text used to call the grep command. I have different copies of this file in both my home directory and my root directory. This is completely unnecessary. If the developer really felt that creating a file was necessary, then at least one of two things should happen. First, AquaGrep should definitely delete the file once it is no longer necessary. Second, the file could be made invisible so it does not create clutter in the Finder.

GUI wrappers are becoming more and more common as Mac users discover the power of the command-line tools included with OS X. Cocoa Dev Central has even run a pair of tutorials (found here and here) on creating your own wrappers. Furthermore, they are fairly simple to write. For that reason, it is disappointing to see an application like AquaGrep. The user interface is not particularly well designed. It does not take the necessary steps to protect the user from things like spaces in file names. It lets the user run any command-line application, accidentally. When you take into account all the mistakes and annoyances in AquaGrep, it starts to look like the developer threw AquaGrep together over a spare weekend and foisted it on the public. There is no way I can justify spending $10 on this application.

If you really need a graphical interface for grep sorting, you would be better off checking out BBEdit Lite. It includes almost all of AquaGrep’s options, adds the ability to replace text, includes an highly acclaimed text editor, and is free.

Reader Comments (1)

Knox · June 4, 2002 - 14:00 EST #1
You can also check out MacGrep v1.0. The author shares a lot of the same views about charging $10 for writing a wrapper.

Add A Comment





 E-mail me new comments on this article