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.

9. One might use<br />

> complete rm ’p/*/f:^*.{c,h,cc,C,tex,1,man,l,y}/’<br />

to exclude precious source code from rm completion. Of course, one could still<br />

type excluded names manually or override the completion mechanism using<br />

the complete-word-raw or list-choices-raw editor command.<br />

10. The D, F and Tlists are like d, f and t respectively, but they use the select<br />

argument in a different way: to restrict completion to files beginning with a<br />

particular path prefix. For example, the Elm mail program uses = as an<br />

abbreviation for one’s mail directory. One might use<br />

> complete elm c@=@F:$HOME/Mail/@<br />

to complete elm -f = as if it were elm -f ~/Mail/. We used @ instead of / to<br />

avoid confusion with the select argument, and we used $HOME instead of ~<br />

because home directory substitution only works at the beginning of a word.<br />

11. suffix is used to add a nonstandard suffix (not space or ’/’ for directories) to<br />

completed words. For example,<br />

> complete finger ’c/*@/$hostnames/’ ’p/1/u/@’<br />

completes arguments to finger from the list of users, appends an @, and then<br />

completes after the @ from the hostnames variable. Note the order in which<br />

the completions are specified.<br />

12. A more complex example:<br />

complete find \<br />

’n/-name/f/’ ’n/-newer/f/’ ’n/-{,n}cpio/f/’ \<br />

’n/-exec/c/’ ’n/-ok/c/’ ’n/-user/u/’ \<br />

’n/-group/g/’ ’n/-fstype/(nfs 4.2)/’ \<br />

’n/-type/(b c d f l p s)/’ \<br />

’c/-/(name newer cpio ncpio exec ok user \<br />

group fstype type atime ctime depth inum \<br />

ls mtime nogroup nouser perm print prune \<br />

size xdev)/’ \<br />

’p/*/d/’<br />

This completes words following -name, -newer, -cpio or ncpio (note the pattern<br />

which matches both) to files, words following -exec or -ok to commands, words<br />

following user and group to users and groups respectively and words following<br />

-fstype or -type to members of the given lists. It also completes the switches<br />

themselves from the given list (note the use of c-type completion) and<br />

completes anything not otherwise completed to a directory.<br />

Programmed completions are ignored if the word being completed is a tilde<br />

substitution (beginning with ~) or a variable (beginning with $). complete is an<br />

experimental feature, and the syntax may change in future versions of the<br />

shell. See also the uncomplete built-in command.<br />

Related information<br />

tcsh, uncomplete<br />

dirs built-in command for tcsh: Print the directory stack<br />

Format<br />

dirs [-l] [-n|-v]<br />

dirs -S|-L [filename]<br />

dirs -c<br />

tcsh: complete<br />

Chapter 2. Shell command descriptions 679

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

Saved successfully!

Ooh no, something went wrong!