# Chapter 4. Advanced Features of the Shell

The basic shell functions were introduced in a prior chapter in order to provide an understanding of how basic OS-9 commands work. In this section the more advanced capabilities of the shell are discussed. In addition to basic command line processing, the shell has functions that facilitate:

- I/O redirection (including filters)

- Memory Allocation

- Multitasking (concurrent execution)

- Procedure File Execution (background processing)

- Execution Control (built-in commands)

There is a virtually unlimited combination of ways these capabilities can be used, and it is impossible to give more than a representative set of examples in this manual. You are therefore encouraged to study the basic rules, use your imagination, and explore the possibilities on your own.

## A More Detailed Description Command Line Processing

The shell is a program that reads and processes command lines one at a time from its input path (usually your keyboard). Each line is first scanned (or “parsed”) in order to identify and process any of the following parts which may be present:

- A program, procedure file, or built-in command name (“verbs”)

- Parameters to be passed to the program

- Execution modifiers to be processed by the shell

Note that only the verb (the program or command name) need be present, the other parts are optional. After the verb has been identified, the shell processes modifiers (if any). Any other text not yet processed is assumed to be parameters and passed to the program called.

Unless the verb is a “built-in command”, the shell will run the program named as a new process (task). It then deactivates itself until the program called eventually terminates, at which time it gets another input line, then the process is repeated. This happens over and over until an end-of-file condition is detected on the shell's input path which causes the shell to terminate its own execution.

Here is a sample shell line which calls the assembler:

    asm sourcefile l -o >/p #12k

In this example:

asm | is the verb
sourcefile l -o | are parameters passed to asm
>/p | is a modifier which redirects the output (listing) to the system's printer
#12K | is a modifier which requests that the process be assigned 12K bytes of memory instead of its (smaller) default amount.

The verb must be the first name in the command line. After it has been scanned, the shell first checks if it is a “built-in” command. If it is, it is immediately executed. Otherwise, the shell assumes it is a program name and attempts to locate and execute it.