2.3 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 programs may accept options and arguments on their command lines. But, once you start a program, it prints its own prompt and/or menus, and it understands its own commands. It also takes instructions from your keyboard that weren't given on its command line.

For instance, if you enter ftp at a shell prompt, you'll see a new prompt from the ftp program. Enter FTP commands to transfer files to and from remote systems. When you enter the special command quit to quit the ftp program, ftp will stop prompting you. Then you'll get another shell prompt, where you can enter other Unix commands.

Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net