Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Find

Built-in

SYNTAX

Find selectionExpression [window] [-c n]

DESCRIPTION

The Find command finds and selects the text (selectionExpression) in the specified window. Text can be specified via a literal string or text pattern enclosed in slash marks (/ /), called a selection expression, or via a marker name with which text has been previously marked.

Normally searches are not case sensitive. To specify case-sensitive searches, you can either set the MPW Shell variable {CaseSensitive} to a nonzero value or click the checkbox labeled Case Sensitive in the dialogs displayed by the Find and Replace menu items.

Note
Searches do not necessarily start at the beginning of a window. A forward search begins at the end of the current selection and continues to the end of the document. A backward search begins at the start of the current selection and continues to the beginning of the document. •

INPUT

None

OUTPUT

None

ALIAS RESOLUTION

This command resolves Finder aliases that are part of a partial or complete pathname substituted for the window name. The resolved pathname must specify the name of an open window. Note that using a shell variable to designate a window is usually faster than requiring MPW to resolve a Finder alias.

STATUS

Find can return the following status codes:

0

at least one instance of the selection found

1

syntax error

2

any other error

PARAMETERS

selectionExpression

Specifies by selection expression or by marker name the text you want to find. Selection expressions include regular expressions and certain MPW-specific symbols and are usually delimited by slash marks (/ /). If you specify a selection expression, Find locates the text that matches the literal string or text pattern defined by it.

Specifying a marker name locates the text that has been marked with that name. Since a marker is not a selection expression, marker names should not be enclosed in slash marks (/ /).

window

Specifies the window in which the selection can be found. If you omit the window parameter, Find uses the target window.

OPTIONS

-c n

Finds and selects the nth occurrence of selection. The default value of n is 1.

EXAMPLES

The following command line finds the first occurrence of the string "Begin" in the Sample window:

Find /Begin/ Sample

The following command line positions the insertion point at the beginning of the target window:

Find •

Using -c, this line selects the fifth occurrence of the string "procedure" in the Sample.p window:

Find -c 5 /procedure/ Sample.p

The following line selects line 332 in the target window:

Find 332

The following line selects a range of lines; the colon between the desired starting and ending line numbers specifies the range.

Find 10:100

 
 


Last Updated July 2000