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

MPW Command Reference


Quote

Built-in

SYNTAX

Quote [parameter1] [parameter2]… [-n]

DESCRIPTION

The Quote command writes the values of its parameters, separated by spaces and terminated by a return. The command performs exactly the same function as Echo, except that it places single quotation marks around parameters containing special characters. This is especially useful when using MPW Shell commands to write a script.

In addition to spaces, tabs, carriage returns, and null characters, the following MPW special characters are enclosed in quotation marks:

# ; & | ( ) ∂ ' " / \ { } ` ? ≈ [] + * « » ® < > ≥ …

INPUT

None

OUTPUT

Standard output. Parameters are written to standard output, enclosed in single quotation marks if they contain special characters.

STATUS

Quote always returns a status code of 0 (no errors).

PARAMETERS

parameter1 [parameter2]…

Specifies one or more parameters.

OPTIONS

-n

Inhibits writing a return following the last parameter. The insertion point remains at the end of the output.

EXAMPLES

The following example demonstrates the difference between Quote, which places quotation marks around parameters containing special characters, and Echo, which does not. The command lines

Quote ≈.a
Echo ≈.a

produce the following output:

Sample.a Count.a 'My Program.a'
Sample.a Count.a My Program.a

In the next example, the output directly follows the command line that generates it in order to demonstrate how Quote processes single quotation marks within parameters:

Quote Notice what happens to single quotes: "--'--"
Notice what happens to single quotes: '--'∂''--'

Because single quotation marks can't appear within the single quotation marks in the output line, they are replaced with '∂'' which closes the original single quotation mark, adds a literal quotation mark, and reopens the single quotation marks.

The For loop shown next, writes a Print command for each file that matches the pattern "≈.a":

For file In ≈.a
  Quote Print "{file}"
End

These commands can then be selected and executed. Notice the quotation marks in the last Print command.

Print Sample.a
Print Count.a
Print 'My Program.a'

LIMITATIONS

The Quote command does not accept standard input.

SEE ALSO

Echo

Parameters

 
 


Last Updated July 2000