16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

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.

Note: Editor commands do not have the same notion of a word as does the tcsh<br />

shell. The editor delimits words with any non-alphanumeric characters not in<br />

the shell variable wordchars, while the tcsh shell recognizes only whitespace<br />

and some of the characters with special meanings to it, listed under<br />

“<strong>Command</strong> syntax” on page 636.<br />

Completion and listing<br />

The tcsh shell is often able to complete words when given a unique abbreviation.<br />

Type part of a word (for example ls /usr/lost) and press the tab key to run the<br />

complete-word editor command. The shell completes the filename /usr/lost to<br />

/usr/lost+found/, replacing the incomplete word with the complete word in the input<br />

buffer. (Note the terminal / (forward slash); completion adds a / to the end of<br />

completed directories and a space to the end of other completed words, to speed<br />

typing and provide a visual indicator of successful completion. The addsuffix shell<br />

variable can be unset to prevent this.) If no match is found (for example,<br />

/usr/lost+found doesn’t exist), the terminal bell rings. If the word is already<br />

complete (for example, there is a /usr/lost on your system, or you were thinking too<br />

far ahead and typed the whole thing), a / or space is added to the end if it isn’t<br />

already there.<br />

Completion works anywhere in the line, not just at the end; completed text pushes<br />

the rest of the line to the right. Completion in the middle of a word often results in<br />

leftover characters to the right of the cursor which need to be deleted.<br />

<strong>Command</strong>s and variables can be completed in much the same way. For example,<br />

typing em [tab] would complete ’em’ to ’emacs’ if emacs were the only command<br />

on your system beginning with ’em’. Completion can find a command in any<br />

directory in the path or if given a full pathname. Typing echo $ar[tab] would<br />

complete ’$ar’ to ’$argv’ if no other variable began with ’ar’.<br />

The shell parses the input buffer to determine whether the word you want to<br />

complete should be completed as a filename, command or variable. The first word<br />

in the buffer and the first word following ’;’, ’|’, ’|&’, ’&&’ or ’||’ is considered to be a<br />

command. A word beginning with ’$’ is considered to be a variable. Anything else is<br />

a filename. An empty line is completed as a filename.<br />

You can list the possible completions of a word at any time by typing ^D to run the<br />

delete-char-or-list-or-eof editor command. The tcsh shell lists the possible<br />

completions using the ls-F built-in and reprints the prompt and unfinished command<br />

line, for example:<br />

> ls /usr/l[’^D]<br />

lbin/ lib/ local/ lost+found/<br />

> ls /usr/l<br />

If the autolist shell variable is set, the tcsh shell lists the remaining choices (if any)<br />

whenever completion fails:<br />

> set autolist<br />

> nm /usr/lib/libt[tab]<br />

libtermcap.a@ libtermlib.a@<br />

> nm /usr/lib/libterm<br />

tcsh<br />

If autolist is set to ambiguous, choices are listed only if multiple matches are<br />

possible, and if the completion adds no new characters to the name to be matched.<br />

Chapter 2. Shell command descriptions 629

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

Saved successfully!

Ooh no, something went wrong!