Previous Next Chapter

Running Programs

Most programs can be run from both the Workbench and the Shell. To run a program from the Shell, you usually enter the program name at the Shell prompt. (If the program file is not in the search path, you must specify the complete path to the file.) This tells AmigaDOS to load and execute the program.

Most programs allow you to specify additional information on the command line after the program name, such as the name of a file to load or startup options. These additional items are ist arguments. Refer to a program's documentation to determine the arguments it allows and how they should be entered.

For example:

1> MEmacs

loads and runs the MEmacs editor. Adding an argument:

1> MEmacs S:User-startup

loads and runs MEmacs, automatically opening the User-startup file in the S: directory as the file to begin editing.

1> CLOCK WIDTH 200 HEIGHT 100 SECONDS

loads the Clock with a specified size of 200 pixels by 100 pixels and the SECONDS option turned on.

Often this argument-passing ability is provided as a convenience, allowing you to specify directly on the command line what might otherwise require several menu operations. However, many programs, especially those that can only be run from a Shell, require that file names or other arguments be specified on the command line with the program name.

Running Programs in the Background

Another way to enter a program name is with the RUN command. RUN loads and runs a program in the background. The Shell prompt returns after the program is opened.

For example, entering:

1> MEmacs

opens the MEmacs editor, but you cannot enter any additional commands or close the Shell window until you exit MEmacs.

However, entering:

1> RUN MEmacs

opens the MEmacs editor and returns the Shell prompt so that you can enter additional commands.

When a program is invoked with RUN, a process number is assigned to it and a message indicating the new process number is displayed, such as [CLI 2] .

Any output that the program generates appears in the originating Shell window.

You cannot close the Shell window if any programs launched from that window are still running. For example, if you open MEmacs through the Shell, you cannot close the Shell window until you exit MEmacs. Avoid this by using the NIL: device. See Chapter 8 for an example.

Top Previous Next Chapter