Types of Commands

When you use a program, you’ll want to know how to control it. How can you tell it what job you want done? Do you give instructions before the program starts, or after it’s started? There are several general ways to give commands on a Mac OS X system. It’s good to be aware of them.

Graphical programs

Some programs work only within the graphical window environment (on Mac OS X, this is called Aqua). On Mac OS X, you can run these programs using the open command. For instance, when you type open -a Chess at a shell prompt, the chess game starts. It opens one or more windows on your screen. The program has its own way to receive your commands—through menus and buttons on its windows, for instance. Although you can’t interact with these programs using traditional Unix utilities, Mac OS X includes the osascript utility, which lets you run AppleScript commands from the Unix shell.

Noninteractive Unix programs

You saw in Section 2.2 that you can enter many Unix commands at a shell prompt. These programs work in a window system (from a Terminal window) or from any terminal. You control those programs from the Unix command line—that is, by typing options and arguments from a shell prompt before you start the program. After you start the program, wait for it to finish; you generally don’t interact with it.

Interactive Unix programs

Some Unix programs that work in the terminal window have commands of their own. (If you’d like some examples, see Chapter 3 and Chapter 4.) These ...

Get Learning Unix for Mac OS X Panther now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.