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

MPW Command Reference


Parameters

Built-in

SYNTAX

Parameters [parameter1] [parameter2]…

DESCRIPTION

The Parameters command writes its parameters, starting with the Parameters command name, to standard output. You can use this command to check the results of such things as variable and command substitution, filename generation, and interpretation of quotation marks and blanks.

INPUT

None

OUTPUT

Standard output. Parameters are written to standard output one per line, each preceded by its parameter number (in braces) and a blank.

STATUS

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

PARAMETERS

parameter1 [parameter2]…

Specifies one or more parameters.

OPTIONS

None

EXAMPLES

The command line

Parameters One Two "and Three"

writes the following four lines to standard output:

{0} Parameters
{1} One
{2} Two
{3} and Three

Notice how the output shows you that "and Three" is processed as a single parameter. The MPW Shell processes a command line and removes any single or double quotation marks around parameters before passing them to the command.

It is easy to make a mistake when composing the parameters to a command, especially when it involves such things as special characters, which are powerful but can be tricky to use. Using the Parameters command can protect you against irreversible mistakes by revealing the actual value of parameters before the command is executed. For example, it is imperative that you test the outcome before using a command such as

Delete ≈ .test

Executing a Parameters command with the same regular expression reveals that executing the previous command would have deleted the contents of the current directory and would then have attempted to delete something called .test.

Parameters ≈ .test

In this case, the blank space between the ≈ wildcard character and .test causes the MPW Shell to interpret them as separate parameters, thus matching the contents of the current directory (≈) and a nonexistent file named .test, respectively.

To delete the desired test files, this is the correct command line:

Delete ≈.test

SEE ALSO

Echo

Quote

 

 
 


Last Updated July 2000