Chapter 13: Juggling a Bunch of Programs
Overview
In This Chapter
What processes are
Where processes come from
What a background program is
How to shuffle background programs around
Hints about windows and background programs
If you have a plain old terminal with no windowing system, you may be envious of users with fancy window systems who can pop up a bunch of windows and run umpteen programs at a time.Don’t. Any UNIX system enables you to run as many programs simultaneously as you want. Nearly all the systems let you stop and restart programs and switch around among different programs whenever you want.If you’re used to an old-fashioned, one-program-at-a-time system, such as DOS (without Windows) or the pre-System 7 Mac, you may not see the point of doing several things at a time. Suppose, however, that you’re doing something that takes awhile and the computer can manage with little or no supervision from you, such as copying a large file over a network (which can take 10 or 15 minutes). You have no reason to sit and wait for that process to finish — you can do something useful while the copy runs in the background.Or, suppose that you’re in the middle of a program and you want to do something else: You’re writing a memo in a text editor and need to check some e-mail you received to make sure that you spelled someone’s name right. One way to do that is to save the file, leave the editor, run the mail program, leave the mail program, start the editor again, return to the same place in the file, and pick up where you left off. What a pain. UNIX enables you to stop the editor, run the mail program, and resume the editor exactly where you left it. For that matter, you can run both the editor and the mail program and flip between them as necessary.
If you’re running Motif or any other X Window Graphical User Interface (GUI), you probably already figured out how to run many programs at a time: Open several xterm windows and run a program in each one. You create a new window by moving the mouse outside of any window, holding down the left mouse button to get a menu and selecting New Window or something similar. If you’re running a version of CDE, running many programs at a time is even easier: Just double-click the icon for each program you want to run. That’s it. You don’t even have to deal with opening xterm windows.Read this chapter anyway, however, particularly the sidebar “Do windows and job control mix?” later in this chapter.
In the interest of fairness, we must point out that job control, the feature that enables you to flip back and forth, was written by Bill, the same guy who wrote the C shell, vi , and NFS (Network File System, described in Chapter 16). In contrast to our opinion of some of his other efforts, we think that job control is pretty cool.Tip If you have a process that has run amok, see Chapter 24 to find out how to kill it.