Intel XENIX 286 Programmers Guide (86) - Tenox.tc
Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc
XENIX Programming Programming Commands csh - Invokes a shell command interpreter with C-like syntax. Syntax csh [ -cefi nstvVxX ] [ arg ] ... Description csh is a command language interpreter. It begins by executing commands from the file .cshrc in the home directory of the invoker. If this is a login shell, then it also executes commands from the file .login there. In the normal case, the shell will then begin reading commands from the terminal, prompting with 96. (The processing of arguments and the use of the shell to process files containing com mand scripts is described later.) The shell then repeatedly performs the following actions: a line of command input is read and broken into words. This sequence of words is placed on the command history list and then parsed. Finally, each command in the current line is executed. When a login shell terminates, it executes commands from the file .logout in the user's home directory. Lexical Structure The shell splits input lines into words at blanks and tabs with the following exceptions. The characters &, I, ;, < , >, (, ) form separate words. If doubled in &&, II, , these pairs form single words. These parser metacharacters may be made part of other words or denied their special meaning by placing a backslash (\} ahead of them. A newline preceded by a \ is equivalent to a blank. In addition, strings enclosed in matched pairs of quotations--', ; or "--form parts of a word; metacharacters in these strings, including blanks and tabs, do not form separate words. The semantics for these quotations will be described later in this entry. Within pairs of \ or " characters, a newline preceded by a \ gives a true newline character. When the shell's input is not a terminal, the character # introduces a com ment that continues to the end of the input line. The character does not have this special meaning when preceded by \ and placed inside the quotation marks ', ; and "· Commands A simple command is a sequence of words, the first of which specifies the command to be executed. A simple command or a sequence of simple commands separated by vertical bar (I} characters forms a pipeline. The output of each command in a pipeline is connected to the input of the next. Sequences of pipelines may be separated by ; and executed sequentially. A sequence of pipelines may be executed without waiting for it to terminate by following it with an ampersand (&). Such a sequence cannot be terminated by a hangup signal; the nohup command need not be used. 8-35
Programming Commands XENIX Programming csh (continued) Any of these characters may be placed in parentheses to form a simple command, which may be a component of a pipeline. It is also possible to separate pipelines with II or && indicating, as in the C language, that the second is to be executed only if the first fails or succeeds, respectively. (See the section on "Expressions" later in this entry.) Substitutions The following sections describe the various transformations the shell performs on the input. It performs substitutions in the order the input demands, not necessarily in the order presented here. History Substitutions History substitutions can be used to reintroduce sequences of words from previous commands, possibly performing modifications on these words. Thus, history substitutions provide a generalization of a redo function. History substitutions begin with the exclamation point character (!) and may begin anywhere in the input stream if a history substitution is not already in progress. This ! may be preceded by a \ to prevent its special meaning. An ! is passed unchanged when it is followed by a blank, tab, newline, =, or (. History substitutions also occur when an input line begins with a caret ("). This special abbreviation will be described later. Any input line that contains history substitution is echoed on the terminal before it is executed as it could have been typed without history substitution. Commands input from the terminal that consist of one or more words are saved on the history list, the size of which is controlled by the history variable. The previous command is always retained. Commands are numbered sequentially from 1. For example, consider the following output from the history command: 9 write michael 10 ex write.c 11 cat oldwrite.c 12 diff *write.c The commands are shown with their event numbers. It is not usually necessary to use event numbers, but the current event nu mber can be made part of the prompt by placing an ! in the prompt string. With the current event 13, we can refer to previous events by event number !11. We can also refer to them relatively, as in !-2 (which refers to the same event), by a prefix of a command word, as in !d for event 12 or !w for event 9, or by a string contained in a word in the command, as in !?mic? (which also refers to event 9). These forms, without further modification, simply reintroduce the words of the specified events, each separated by a single blank. As a special case, !! refers to the previous command; thus !! alone is essentially a redo. The form !# references the current command (the one being typed in). It allows a word to be selected from further left in the line to avoid retyping a long name, as in !#:1. B-36
- Page 249 and 250: m4: Macro Processor XENIX Programmi
- Page 251 and 252: m4: Macro Processor XENIX Programmi
- Page 253 and 254: C Language Portability XENIX Progra
- Page 255 and 256: C Language Portability XENIX Progra
- Page 257 and 258: C Language Portability XENIX Progra
- Page 259 and 260: C Language Portability XENIX Progra
- Page 261 and 262: C Language Portability XENIX Progra
- Page 263 and 264: C Language Portability XENIX Progra
- Page 266 and 267: APPENDIX B PROG RAMMING COMMANDS Th
- Page 268 and 269: XENIX Programming ad b (continued)
- Page 270 and 271: XENIX Programming Programming Comma
- Page 272 and 273: XENIX Programming Programming Comma
- Page 274 and 275: XENIX Programming Programming Comma
- Page 276 and 277: XENIX Programming Programming Comma
- Page 278 and 279: XENIX Programming Programming Comma
- Page 280 and 281: XENIX Programming Programming Comma
- Page 282 and 283: XENIX Programming Programming Comma
- Page 284 and 285: XENIX Programming as (continued) Fi
- Page 286 and 287: XENIX Programming Programming Comma
- Page 288 and 289: XENIX Programming Programming Comma
- Page 290 and 291: XENIX Programming Programm ing Comm
- Page 292 and 293: XENIX Programming Programming Comma
- Page 294 and 295: XENIX Programming Programming Comma
- Page 296 and 297: XENIX Programming Programm ing Comm
- Page 298 and 299: XENIX Programming Programming Comma
- Page 302 and 303: XENIX Programming Programming Comma
- Page 304 and 305: XENIX Programming Programming Comma
- Page 306 and 307: XENIX Programming Programming Comma
- Page 308 and 309: XENIX Programming Programming Comma
- Page 310 and 311: XENIX Programming Programming Comma
- Page 312 and 313: XENIX Programming Programming Comma
- Page 314 and 315: XENIX Programm ing Programming Comm
- Page 316 and 317: XENIX Programming Programming Comma
- Page 318 and 319: XENIX Programming Programming Comma
- Page 320 and 321: XENIX Programming Programming Comma
- Page 322 and 323: XENIX Programming Programming Comma
- Page 324 and 325: XENIX Programming Programming Comma
- Page 326 and 327: XENIX Programming Programming Comma
- Page 328 and 329: XENIX Programming Programming Comma
- Page 330 and 331: XENIX Programming Programming Comma
- Page 332 and 333: XENIX Programming Programming Comma
- Page 334 and 335: XENIX Programming Programming Comma
- Page 336 and 337: XENIX Programming Programming Comma
- Page 338 and 339: XENIX Programming Programming Comma
- Page 340 and 341: XENIX Programming Programming Comma
- Page 342 and 343: XENIX Programming Programming Comma
- Page 344 and 345: XENIX Programming lex (continued) E
- Page 346 and 347: XENIX Programming Programming Comma
- Page 348 and 349: XENIX Programming Programming Comma
<strong>XENIX</strong> Programming Programming Commands<br />
csh - Invokes a shell command interpreter with C-like syntax.<br />
Syntax<br />
csh [ -cefi nstvVxX ] [ arg ] ...<br />
Description<br />
csh is a command language interpreter. It begins by executing commands from the file<br />
.cshrc in the home directory of the invoker. If this is a login shell, then it also executes<br />
commands from the file .login there. In the normal case, the shell will then begin<br />
reading commands from the terminal, prompting with 96. (The processing of arguments<br />
and the use of the shell to process files containing com mand scripts is described later.)<br />
The shell then repeatedly performs the following actions: a line of command input is<br />
read and broken into words. This sequence of words is placed on the command history<br />
list and then parsed. Finally, each command in the current line is executed.<br />
When a login shell terminates, it executes commands from the file .logout in the user's<br />
home directory.<br />
Lexical Structure<br />
The shell splits input lines into words at blanks and tabs with the following exceptions.<br />
The characters &, I, ;, < , >, (, ) form separate words. If doubled in &&, II, ,<br />
these pairs form single words. These parser metacharacters may be made part of other<br />
words or denied their special meaning by placing a backslash (\} ahead of them. A<br />
newline preceded by a \ is equivalent to a blank.<br />
In addition, strings enclosed in ma<strong>tc</strong>hed pairs of quotations--', ; or "--form parts of a<br />
word; metacharacters in these strings, including blanks and tabs, do not form separate<br />
words. The semantics for these quotations will be described later in this entry. Within<br />
pairs of \ or " characters, a newline preceded by a \ gives a true newline character.<br />
When the shell's input is not a terminal, the character # introduces a com ment that<br />
continues to the end of the input line. The character does not have this special meaning<br />
when preceded by \ and placed inside the quotation marks ', ; and "·<br />
Commands<br />
A simple command is a sequence of words, the first of which specifies the command to<br />
be executed. A simple command or a sequence of simple commands separated by<br />
vertical bar (I} characters forms a pipeline. The output of each command in a pipeline is<br />
connected to the input of the next. Sequences of pipelines may be separated by ; and<br />
executed sequentially. A sequence of pipelines may be executed without waiting for it<br />
to terminate by following it with an ampersand (&). Such a sequence cannot be<br />
terminated by a hangup signal; the nohup command need not be used.<br />
8-35