• Keine Ergebnisse gefunden

Command Format

Im Dokument apollo Aegis (Seite 32-37)

Shell Basics

1.1 Command Format

In the most general sense, the operating system has no commands. There are sim-ply files that the shell looks for and executes. When you type "date" in the shell input window, the shell looks for a file called date (following its command search rules) and executes it. This means that you can give any files that you create to the shell for execution. Of course, if you tell the shell to execute a file containing non-binary data -- like the text of a memo -- you get an error message. The point is that you can give any file, no matter where it comes from, to the shell for interpretation and execution.

The simplest command line consists of a command name followed by arguments to the command, separated by spaces:

commcmd argJ arg2 ... argn 1.1.1 Arguments

The command shell, which we supply, handles commands that accept multiple arguments (see Figure 1-1). Usually, those arguments come in two forms: a path-name designating a file on which to operate or some other sort of literal string for manipulation, and instructions for special command action. Those arguments that specify special action are almost always optional, and are immediately preceded by a hyphen (-). The hyphen is necessary because these arguments often require secondary arguments of their own. The commands use the hyphen to interpret correctly where all the different arguments apply. These special arguments are labeled OYfIONS in the command descriptions in Chapter 2.

~ ~d ~y _ ~ir -len

1 1 1 1 _ _ Option (command modifier)

1 1 1 Argument (object of command action) 1 1 Command (list_directory)

1 Shell prompt

Figure 1-1. Typical Shell Command Format 1.1.2 Separators

Normally, you separate shell commands from each other by carriage returns (new-line characters). You can place multiple commands on the same (new-line by separating them with semicolons, up to a total of 256 characters per line. For example,

$ wd Ilmydirisubi ;ld

This command line sets your working directory to the directory Ilrnydirlsubl and then lists the contents of that directory.

You can also put multiple commands on a single line when you use pipes and filters.

1.1.3 Node Specifications

Many shell commands require you to identify a target node on which the com-mands are to operate. For example, the crp command needs to know which node will host the new process. Use a node specification to identify nodes.

A node specification permits a node's communications software to locate other nodes in a local ring or in an internet (a network composed of individual network rings joined via Domain/Bridges™. This node specification can be either an inter-net address or a node name.

1.1.3.1 Internet Addresses

An internet address has the following format:

The net represents a network number and the node _id represents a hexadecimal node ID. A network number of 0 refers to the local network.

If a node is cataloged (in either your local cache or the ns hel per database), you can omit the network number when you use an internet address. When you provide

only the node ID, Domain/OS gets the network number from either your local cache or the ns _helper database. However, if you provide a complete internet address, Aegis attempts to locate the node only on the network you specify. Thus, if you specify an incorrect network number, Domain/OS looks for the node only on the network that you specify and then reports an error; Domain/OS does not attempt to locate the node on another network.

If a node is not cataloged, Domain/OS cannot get a network number if you omit it.

In this case, Domain/OS assumes that the node is on the local ring. Thus, for an uncataloged node on the local network, you must provide the node ID, but the net-work number is optional. However, you must provide both the netnet-work number and node ID for an uncataloged node on a remote network.

l.l.3.2 Node Names A node name has the format:

Ilnode name

You can use a node name as a node specification only if the node is cataloged (in either your local cache or the the ns _helper database.) When you use a node name, Aegis gets the internet address associated with that name. If a node is not

cataloged, you must use an internet address to specify the node.

Note that you can catalog and name both disked and diskless nodes.

1.l.3.3 Node Specification Examples

The following examples illustrate ways you can specify a node with an ID of AI05, a name of IIcasey, and a network number of 405 I 237A. (These examples assume that IIcasey is cataloged in the ns_helper database.)

$Iusr -n OA105

Note that hex IDs that start with a letter must be preceded by a '0' for the shell to parse them correctly.

$ lusr -n IIcasey

$Iusr -n 4051237A.AI05

If you are using a node on ring 4051237A, you can also use the following internet address to refer to IIcasey:

$ lusr -n O.A I 05

1.2 Using Special Characters

The shell recognizes a variety of special characters that allow you to change the action of commands. The characters in Table 1-1 have special meanings when they appear on a command line. Note that while some of these characters have been dis-cussed as having special meanings in Display Manager (OM) commands, regular expressions, and so forth, those meanings do not necessarily carry over to the Aegis environment. Please be careful to keep the different meanings !iistinct: for exam-ple, you should enclose regular expressions appearing in Aegis commands in quota-tion marks to avoid confusion.

The at sign (@) is the shell's escape character. You can place an "@" anywhere on the command line to suppress the special meaning of the next character (including the "@" character itselt). See Using Your Aegis Environment for a full discussion of the usage of shell special characters.

Table 1-1. Command Shell Special Characters Pathname Wildcards

Character Usa2e

? Match any single character except newline.

% Match zero or more characters up to but not including the period.

*

Match zero or more occurrences of the preceding character.

[string] Match any single character in the character class string.

[-string] Match any character except those in string.

... Match zero or more subordinate directories .

=

Copy (derive) leafname from previous argument.

(names) Group patbnames for use in later derived names.

{expr} Tag expression for later use.

(Continued)

Table 1-1 Command Shell Special Characters (Cont.) Input/Output Control

Character Usa~e Notes

< Redirect standard input (3)

<1 Redirect error input (3)

«I Read in-line data from standard input (3)

«11 Read in-line data from error input (3)

> Redirect standard output (3)

>1 Redirect error output (3)

» Append standard output (3)

»1 Append error output (3)

I Pipe standard output (1)

() Group commands for I/O redirection (1)

Parsinl! Operators

Character Usal!e Notes

# Comment line in a command file (4)

& Run a program or command in the back- (1) ground

A Insert parameter (3)

! Insert parameter and rescan (3)

"'cmd" Insert output of "cmd". with expansion (3) .... 'cmd' Insert output of "cmd". no expansion (3)

.

Separate commands on a line (1)

" Quoted string, with expansion (4)

, Quoted string. no expansion (4)

@ Escape character (5)

Space (2)

Notes:

1. Special anywhere; causes a new command to start.

2. Special anywhere; causes a new argument to start.

3. Special anywhere; does not start a new argument.

4. Special only at the beginning of an argument.

5. Special only intrnediately before an otherwise special character.

Im Dokument apollo Aegis (Seite 32-37)