next up previous contents
Next: File Specification Up: UNIX Previous: Command Recall   Contents

Filename Completion

Another feature of C shell (and consequently T shell) and the bash shell that saves typing, is Filename Completion. Shell commands frequently end with a file name and, once enough of the file name has been typed to make in unambiguous, the shell will complete it if Tab is pressed. If ambiguous, the shell will try to complete it by adding that part of the name that is common to all matching files, before beeping a warning that the name is incomplete. Alternatively, Ctrl D can be pressed which causes the shell to list all the possible file names that still match and then restore the partial command.

You can tell C shell to ignore files with certain suffices when looking for matches. For example the command:-

set fignore = (.o .out)
means that files ending in .o or .out, will not match.

The system also works for environmental and shell variable completion, we will learn about these variables later in the chapter on Programming in a UNIX Environment (in section 6.2.5).



P.D. Gronbech (IT Staff) 2015-10-02