09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

csh: C Shell <strong>XENIX</strong> Programming<br />

The C shell variable time is set to 15, causing the C shell to automatically print<br />

statistics lines for commands that execute for at least 15 seconds of CPU time. The<br />

variable history is set to 10, indicating that the C shell will remember the last 10<br />

commands typed in its history list (described later). Finally, the <strong>XENIX</strong> mail program is<br />

invoked.<br />

When the C shell finishes processing the .login file, it begins reading commands from the<br />

terminal, prompting for each with<br />

%<br />

When you log out (by giving the logout command) the C shell prints<br />

logout<br />

and executes commands from the file .logout if it exists in your home directory. After<br />

that, the C shell term inates and <strong>XENIX</strong> logs you off the system.<br />

Using Shell Variab les<br />

The C shell maintains a set of variables. For example, in the above discussion, the<br />

variables history and time had the values 10 and 15. Each C shell variable has as its<br />

value an array of zero or more strings. C shell variables may be assigned values by the<br />

set command, which has several forms, the most useful of which is<br />

set name = value<br />

C shell variables can be used to store values to be used later in commands through a<br />

substitution mechanism. The C shell variables most commonly referenced are, however,<br />

those that the C shell itself refers to. By changing the values of these variables you can<br />

directly affect the behavior of the C shell.<br />

One of the most important variables is path, which contains a list of directory names.<br />

When you type a command name at your terminal, the C shell examines each named<br />

directory in turn until it finds an executable file with a name that corresponds to the<br />

name you typed. The set command with no arguments displays the values of all<br />

variables currently defined in the C shell. The following example shows typical default<br />

values:<br />

argv ()<br />

home /usr/bill<br />

path (. /bin /usr/bin)<br />

prompt %<br />

shell /bi n/csh<br />

status 0<br />

This output indicates that the variable path begins with the current directory indicated<br />

by dot (.), then /bin, and last /usr/bin. Your own local commands may be in the current<br />

directory. Normal <strong>XENIX</strong> commands reside in /bin and /usr/bin.<br />

8-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!