Copyright (c) Hyperion Entertainment and contributors.

AmigaOS Manual: AmigaDOS Understanding the Shell

From AmigaOS Documentation Wiki
Revision as of 17:37, 24 January 2014 by Steven Solie (talk | contribs) (Created page with "An AmigaDOS Shell is a special window on the Workbench screen that accepts text input, allowing you to communicate with AmigaDOS. The Shell is a type of Command Line Interface...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

An AmigaDOS Shell is a special window on the Workbench screen that accepts text input, allowing you to communicate with AmigaDOS. The Shell is a type of Command Line Interface or CLI. This chapter describes the following:

  • About the Shell
  • Opening and closing Shell windows
  • Using the Shell

About the Shell

You can communicate directly with AmigaDOS through a Shell console window, a text-only interface that accepts input entered from the keyboard. The Shell window looks and acts like a Workbench window with these exceptions:

  • Icons cannot be dragged into the Shell window.
  • The mouse can only be used for copy and paste operations, except within the ED and MEmacs text editors.
  • Scroll gadgets do not appear.
  • The AmigaDOS Shell window uses only a non-proportional font, normally the System Default Text font (Topaz or Courier) specified by the Font Preferences editor.
  • Any Workbench background patterns set in WBPattern do not appear in Shell windows.

Figure 2-1 illustrates a Shell window opened on the Workbench screen.

Figure 2-1. Shell Window

Like Workbench, several independent Shell windows can be open at the same time. While commands entered in one Shell are being executed, you can enter and execute different commands in another Shell window.

Opening Shell Windows

Shell windows can be opened in one of two ways:

  • Click on the Shell icon in the Workbench System drawer.
  • Use the NEWSHELL command described in Chapter 6.

When a Shell window is opened:

  • The window is highlighted, indicating that it is the current window
  • A prompt appears, such as 1.SYS: >
  • To the right of the prompt is a cursor, a small highlighted rectangle

Like Workbench, only the currently selected window can receive input. To enter information in a different window, click in it to make it the current window. While a Shell window is the current window, no menus are available in the Workbench title bar.

Closing Shell windows

Use one of the following three ways to close a Shell window:

  • Select the close gadget
  • Enter the ENDSHELL command
  • Press Ctrl+\

We recommend closing Shell windows when you are finished with them. Any open window uses memory.

All non-detached programs that run from a Shell must be finished before you can close the window. You can tell that a program is still active if pressing Return does not produce a Shell prompt in the window. Although you can still enter commands into such a window, AmigaDOS does not respond to the commands until the running program is exited.

Using the Shell

Enter AmigaDOS commands at the Shell's text prompt. Include with the command any necessary information, such as file names or command options. Press Return at the end of each command line to execute the command. The Shell prompt reappears when the command is finished executing.

To see command output that has scrolled out of the Shell window, enlarge the window by selecting the Shell zoom gadget or using the sizing gadget. This reveals as much of the previous contents of the window as fits. Figure 2-2 illustrates a Shell window before and after using the zoom gadget to display the entire output of a LIST command.

Figure 2-2. Revealing Previous Output with the Zoom Gadget

Command Line Editing and Control

To simplify entering and editing command line text, the AmigaDOS Shell provides the following editing key and key combination options:

left arrow Moves cursor one character to the left.
right arrow Moves cursor one character to the right.
Shift+left arrow Moves cursor to the beginning of the line.
Shift+right arrow Moves cursor to the end of the line.
Backspace Deletes the character to the left of the cursor.
Del Deletes the character highlighted by the cursor.
Ctrl+H Deletes the last character (same as Backspace).
Ctrl+M Processes the command line (same as Return).
Ctrl+J Adds a line feed.
Ctrl+W Deletes the word to the left of the cursor.
Ctrl+X Deletes the current line.
Ctrl+K Deletes everything from the cursor forward to the end of the line.
Ctrl+Y Replaces the characters deleted with Ctrl+K.
Ctrl+U Deletes everything from the cursor backward to the start of the line.

In addition, the Shell supports the following keys and key combinations:

Space bar (or any printable character) Suspends output (stops scrolling).
Backspace Resumes output (continues scrolling).
Ctrl+C Sends a BREAK command to the current process (halts the process).
Ctrl+D Sends at BREAK command to the current script (halts the script).
Ctrl+F Activates and brings Workbench program windows to the front.
Ctrl+S Suspends output.
Ctrl+Q Resumes output if it was suspended with Ctrl+S.
Ctrl+\ /O is redirected to another device with * restores normal |/O.

The Shell allows you to enter a command or other information while listing output. However, this stops the output until you press the Return key. The new command executes after the output is finished listing.

If you enter a new command or text and then choose to delete it, the original output resumes scrolling as soon as the last character is erased.