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

MPW Command Reference


Appendix C
Dictionary of Special Characters and Operators

This appendix describes the special characters and operators that you can use in commands and scripts. Each special character and operator appears in Table C-1, which includes very brief descriptions, and in the dictionary itself, which has more complete descriptions. The table and the dictionary show the characters and operators in functional groups. Both the table and the dictionary list the functional groups in this order:

arithmetic operators
command terminators
delimiters
logical operators
makefile characters
menu characters
miscellaneous characters
number prefixes
redirection characters
regular and selection expression characters
wildcard characters

To get information on a character or operator, first look it up in Table C-1. Each character has a line in the table, like this one:

§    Option-6    Current selection

The line shows the character, the special keystroke used to type it (if any), and its meaning. If the information in Table C-1 is not enough to answer your questions, you can turn to its page in the dictionary for more information and examples showing how to use the character.

Note that some special characters have more than one meaning and that some characters, such as !~, are combinations of two or more characters.

Table C-1: The MPW Shell special characters and operators

Character

Keystroke

Meaning

Arithmetic Operators

+

 

Addition

÷

Option-/

Division

DIV

 

Division

MOD

 

Modulus

%

 

Modulus

*

 

Multiplication

-

 

Subtraction, sign change

Command Terminators

||

 

If not successful, do . . .

&&

 

If successful, do . . .

;

 

Join commands on one line

Delimiters

" "

 

Enclose a literal string (with exceptions)

' '

 

Enclose a literal string (no exceptions)

( )

 

Group commands or expressions

` `

 

Pass output to another command

`` ``

 

Pass output, saving quotation marks

\ \

 

Search backward

/ /

 

Search forward

« »

Option-\,
Option-Shift-\

Specify a repetition

[ ]

 

Specify a scan set

{ }

 

Enclose a variable

{{ }}

 

Enclose a variable, saving quotation marks

Logical Operators

&

 

Bitwise AND

~

 

Bitwise NOT

|

 

Bitwise OR

^

 

Bitwise XOR

+=

 

Increment a variable

-=

 

Decrement a variable

==

 

Equal to (strings, numbers, and variables)

=~

 

Equivalent to (patterns)

>

 

Greater than

>=

 

Greater than or equal to

Option-. (period)

Greater than or equal to

<

 

Less than

<=

 

Less than or equal to

Option-, (comma)

Less than or equal to

&&

 

Logical AND

AND

 

Logical AND

!

 

Logical NOT

¬

Option-L

Logical NOT

NOT

 

Logical NOT

||

 

Logical OR

OR

 

Logical OR

!=

 

Not equal to (strings, numbers, and variables)

< >

 

Not equal to (strings, numbers, and variables)

Option-=

Not equal to (strings, numbers, and variables

!~

 

Not equivalent to (patterns)

<<

 

Shift left

>>

 

Shift right

Makefile Characters

ƒ

Option-F

Depends on

ƒƒ

Option-F

Depends on, with own build commands

Menu Characters

-

 

Add a separator to a menu

/c

 

Assign the keystroke c to a menu item

(

 

Disable a menu item

!c

 

Mark a menu item with a character

^n

 

Mark a menu item with an icon

<c

 

Set the character style of a menu item

Miscellaneous Characters

Option-D

Change the meaning of the next character

#

 

Comment

:

 

Separate parts of a pathname

Option-;

Start Commando

Number Prefixes

0b

 

Binary number

$

 

Hexadecimal number

0x

 

Hexadecimal number

0

 

Octal number

Redirection Characters

|

 

Pipe output

Option-W

Redirect all output and append

∑∑

Option-W

Redirect all output and replace

≥≥

Option-. (period)

Redirect error messages and append

Option-. (period)

Redirect error messages and replace

<

 

Redirect standard input

>>

 

Redirect standard output and append

>

 

Redirect standard output and replace

Regular and Selection Expression Characters

Option-8

Beginning of file, beginning of line

§

Option-6

Current selection

Option-5

End of file, end of line

:

 

Everything between two selections

¡n

Option-1

Move backward

!n

 

Move forward

¬

Option-L

Not in the following list

+

 

One or more occurrences

Option-J

Place insertion point

-

 

Specify a range of characters

®

Option-R

Tag an expression

*

 

Zero or more occurrences

Wildcard Characters

?

 

Match any character

Option-X

Match any string

 
 


Last Updated July 2000