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.

tcsh<br />

/usr/source/s1/ls.c. The results of matches are sorted separately at a low level to<br />

preserve this order, such as, like the following example, where ../{memo,*box}<br />

might expand to ../memo ../box ../mbox. (Note that ’memo’ was not sorted with the<br />

results of matching ’*box’.) It is not an error when this construct expands to files<br />

which do not exist, but it is possible to get an error from a command to which the<br />

expanded list is passed. This construct may be nested. As a special case the words<br />

{, } and {} are passed undisturbed. The character ~ at the beginning of a filename<br />

refers to home directories. Standing alone, i.e. ~, it expands to the invoker’s home<br />

directory as reflected in the value of the home shell variable. When followed by a<br />

name consisting of letters, digits and - (hyphen) characters the shell searches for a<br />

user with that name and substitutes their home directory; thus ~ken might expand<br />

to /usr/ken and ~ken/chmach to /usr/ken/chmach. If the character ~ is followed<br />

by a character other than a letter or / or appears elsewhere than at the beginning of<br />

a word, it is left undisturbed. A command like setenv MANPATH<br />

/usr/man:/usr/local/man:~/lib/man does not, therefore, do home directory substitution<br />

as one might hope. It is an error for a glob-pattern containing ’*’, ’?’, ’[’ or ’~’, with or<br />

without ’^’, not to match any files. However, only one pattern in a list of<br />

glob-patterns must match a file (so that, for example, rm *.a *.c *.o would fail only if<br />

there were no files in the current directory ending in ’.a’, ’.c’, or ’.o’), and if the<br />

nonomatch shell variable is set a pattern (or list of patterns) which matches nothing<br />

is left unchanged instead of causing an error.<br />

The noglob shell variable can be set to prevent filename substitution, and the<br />

expand-glob editor command, normally bound to ^X-*, can be used to interactively<br />

expand individual filename substitutions.<br />

Directory stack substitution: The directory stack is a list of directories,<br />

numbered from zero, used by the pushd, popd and dirs built-in commands for<br />

tcsh. dirs can print, store in a file, restore and clear the directory stack at any time,<br />

and the savedirs and dirsfile shell variables can be set to store the directory stack<br />

automatically on logout and restore it on login. The dirstack shell variable can be<br />

examined to see the directory stack and set to put arbitrary directories into the<br />

directory stack.<br />

The character = (equal) followed by one or more digits expands to an entry in the<br />

directory stack. The special case =- expands to the last directory in the stack. For<br />

example,<br />

> dirs -v<br />

0 /usr/bin<br />

1 /usr/spool/uucp<br />

2 /usr/accts/sys<br />

> echo =1<br />

/usr/spool/uucp<br />

> echo =0/calendar<br />

/usr/bin/calendar<br />

> echo =-<br />

/usr/accts/sys<br />

The noglob and nonomatch shell variables and the expand-glob editor command<br />

apply to directory stack as well as filename substitutions.<br />

Other substitutions: There are several more transformations involving filenames,<br />

not strictly related to the “Directory stack substitution,” but mentioned here for<br />

completeness. Any filename may be expanded to a full path when the symlinks<br />

variable is set to expand. Quoting prevents this expansion, and the normalize-path<br />

editor command does it on demand. The normalize-command editor command<br />

expands commands in PATH into full paths on demand. Finally, cd and pushd<br />

644 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

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

Saved successfully!

Ooh no, something went wrong!