Choose Custom Commands category from the Properties menu, as shown in Figure 2-45. You use this window to add often-used UNIX commands to your Custom Commands menu. You can even create a command that lets you specify different options every time the command is chosen.
The Custom Command feature assumes that you have some working knowledge of the UNIX operating system. If you are not familiar with UNIX or have problems, you might want to have your system administrator help you create any desired custom commands.
The scrolling list shows your current custom commands. You use this window to add, delete, and change the order of your custom commands.
Follow the steps below to add a new custom command to the Custom Commands Menu Items scroll box. Follow the examples to add a custom command to search for a particular text string in the selected files or folders.
Type the actual UNIX command in the UNIX Command text field.
You can add $FILE or $ARG to the command to represent the currently selected file or special arguments (options) that you can specify at the time you choose the command.
In this example, type grep $ARG $FILE in the UNIX command text field.
Type the name of the command that you want to appear in the Menu Label text field.
This Menu Label does not have to be the actual UNIX command. You may want the command to be something more descriptive.
In this example, type String Search.
Add the item.
To prompt for command options, (that is, if you are using $ARG in the UNIX command), choose Yes on the Prompt Window setting, then type the prompt label into the first line of the Prompt text field.
If you use a prompt window, when the custom command is chosen from the Custom Commands menu a window is displayed with the prompt label. You use this pop-up window to type the command options.
In this example, choose Yes on the Prompt Window setting and type Search For: in the Prompt text field. When your custom command is chosen from the Custom Commands window, a window is displayed in which you can specify the text that you want to search for.
If your custom command will create any output, choose Yes on the Output Window setting.
This causes an output window to be displayed when the custom command is chosen, where you can see the result of your command.
In this example, you want to choose Yes on the Output Window. Then when you choose the new custom command from the Custom Commands menu, a window will be displayed that lists the places the text string is found.
Click SELECT on Apply to add the new command to the Custom Commands scrolling list.
To use the item, select the folders and files where you want to search for text, choose the String Search command from the Custom Commands submenu, and type the text string to search for in the window that is displayed. Press RETURN to quit or SELECT Quit from the output window.