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 (continued) Nonbu ilt- ln Command Execution When a command to be executed is found to not be a built-in command the shell attempts to execute the command via exec. Each word in the variable path names a directory from which the shell will attempt to execute the command. If it is given neither a -c option nor a -t option, the shell will hash the names in these directories into an internal table so that it will try an exec in a directory only if there is a possibility that the command resides there. This greatly speeds command location when a large number of directories are present in the search path. If this mechanism has been turned off (via unhash) or if the shell was given a -c or -t argument and in any case for each directory component of path which does not begin with a /, the shell concatenates with the given command name to form a path name of a file which it then attempts to execute. Parenthesized commands are always executed in a subshell. Thus, (cd ; pwd) ; pwd prints the home directory, leaving you where you were (printing this after the home directory), while cd ; pwd leaves you in the home directory. Parenthesized commands are most often used to prevent cd from affecting the current shell. If the file has execute permissions but is not an executable binary to the system, then it is assumed to be a file containing shell commands, and a new shell is spawned to read it. If there is an alias for shell then the words of the alias will be prepended to the argument list to form the shell command. The first word of the alias should be the full path name of the shell (for example, $shell). Note that this is a special, late occurring case of alias substitution and that it only allows words to be prepended to the argument list without modificat ion. B-53
Programming Commands XENIX Programming csh (continued) Argu ment List Processing If argument 0 to the shell is -, then this is a login shell. The flag arguments are interpreted as follows: -c Commands are read from the (single) following argu ment, which must be present. Any remaining arguments are placed in argv. -e The shell exits if any invoked command terminates abnormally or yields a nonzero exit status. -f The shell will start faster because it will neither search for nor execute commands from the file .cshrc in the invoker's home directory. -i The shell is interactive and prompts for its top-level input, even if it appears not to be a terminal. Shells are interactive without this option if their inputs and outputs are terminals. -n Commands are parsed, but not executed. This may aid in syntactic checking of shell scripts. -s Command input is taken from the standard input. -t A single line of input is read and executed. A \ may be used to escape the newline at the end of this line and continue on to another line. -v Causes the verbose variable to be set, with the effect that command input is echoed after history substitution. -x Causes the echo variable to be set, so that commands are echoed immediately before execution. -V Causes the verbose variable to be set even before .cshrc is executed. -X Causes the echo variable to be set even before .cshrc is executed. If arguments remain after flag arguments are processed but none of the -c, -i, -s, or -t options were given, the first argument is taken as the name of a file of commands to be executed. The shell opens this file and saves its name for possible resubstitution by $0. Since most shell scripts on a typical system are written for the standard shell sh, the C shell will execute such a standard shell if the script does not start with a comment {the first character of a script is not a #). (See the entry sh in "Commands" in the XENIX 286 Reference Manual.) Remaining arguments initialize the variable argv. B-54
- 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 300 and 301: 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 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
- Page 350 and 351: XENIX Programming Programming Comma
- Page 352 and 353: XENIX Programming Programming Comma
- Page 354 and 355: XENIX Programming Programming Comma
- Page 356 and 357: XENIX Programming Programming Comma
- Page 358 and 359: XENIX Programming Programming Comma
- Page 360 and 361: XENIX Programm ing Programming Comm
- Page 362 and 363: XENIX Programming Programming Comma
- Page 364 and 365: XENIX Programming prs (continued) :
- Page 366 and 367: XENIX Programming Programming Comma
Programming Commands <strong>XENIX</strong> Programming<br />
csh (continued)<br />
Argu ment List Processing<br />
If argument 0 to the shell is -, then this is a login shell. The flag arguments are<br />
interpreted as follows:<br />
-c Commands are read from the (single) following argu ment, which must be<br />
present. Any remaining arguments are placed in argv.<br />
-e The shell exits if any invoked command terminates abnormally or yields a<br />
nonzero exit status.<br />
-f The shell will start faster because it will neither search for nor execute<br />
commands from the file .cshrc in the invoker's home directory.<br />
-i The shell is interactive and prompts for its top-level input, even if it appears not<br />
to be a terminal. Shells are interactive without this option if their inputs and<br />
outputs are terminals.<br />
-n Commands are parsed, but not executed. This may aid in syntactic checking of<br />
shell scripts.<br />
-s Command input is taken from the standard input.<br />
-t A single line of input is read and executed. A \ may be used to escape the<br />
newline at the end of this line and continue on to another line.<br />
-v Causes the verbose variable to be set, with the effect that command input is<br />
echoed after history substitution.<br />
-x Causes the echo variable to be set, so that commands are echoed immediately<br />
before execution.<br />
-V Causes the verbose variable to be set even before .cshrc is executed.<br />
-X Causes the echo variable to be set even before .cshrc is executed.<br />
If arguments remain after flag arguments are processed but none of the -c, -i, -s, or -t<br />
options were given, the first argument is taken as the name of a file of commands to be<br />
executed. The shell opens this file and saves its name for possible resubstitution by $0.<br />
Since most shell scripts on a typical system are written for the standard shell sh, the C<br />
shell will execute such a standard shell if the script does not start with a comment {the<br />
first character of a script is not a #). (See the entry sh in "Commands" in the <strong>XENIX</strong><br />
<strong>2<strong>86</strong></strong> Reference Manual.) Remaining arguments initialize the variable argv.<br />
B-54