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.

Quoting can override the special meanings of reserved words and aliases. For<br />

example, in:<br />

"time" program<br />

the quotes around time tell the shell not to interpret time as a shell reserved word.<br />

Instead, sh does a normal command search for a command named time.<br />

You must always quote the following characters if you want sh to interpret them<br />

literally:<br />

| & ; < > ( ) $ ' " ` \<br />

<br />

The following characters need to be quoted in certain contexts if they are to be<br />

interpreted literally:<br />

* ? [ # % =<br />

~<br />

Directory Substitution<br />

When a word begins with an unquoted tilde ( ~), sh tries to perform directory<br />

substitution on the word.sh obtains all characters from the tilde (~) to the first slash<br />

(/) and uses this as a user name. sh looks for this name in the user profile, the file<br />

that contains information on all the system’s users. If sh finds a matching name, it<br />

replaces ~name with the name of the user’s home directory, as given in the<br />

matching RACF user profile entry.<br />

For example, if you specify a filename as:<br />

~jsmith/file<br />

sh would look up jsmith’s home directory and put that directory name in place of<br />

the ~jsmith construct.<br />

If you specify a ~without an accompanying name, sh replaces the ~with the current<br />

value of your HOME variable. For example:<br />

echo ~<br />

displays the name of your home directory. Similarly, sh replaces the construct ~+<br />

with the value of the PWD variable (the name of the your working directory), and<br />

replaces the tilde hyphen (~–) with the value of OLDPWD (the name of your<br />

previous working directory). In variable assignments, tilde expansion is also<br />

performed after colons (:).<br />

Parameter Substitution<br />

The shell uses three types of parameters: positional parameters, special<br />

parameters, and variables. A positional parameter is represented with either a single<br />

digit (except 0) or one or more digits in braces. For example, 7 and {15} are both<br />

valid representations of positional parameters. Positional parameters are assigned<br />

values from the command line when you invoke sh.<br />

A special parameter is represented with one of the following characters:<br />

* @ # ? ! - $ 0<br />

The values to which special parameters expand are listed in the following<br />

paragraphs.<br />

sh<br />

Chapter 2. Shell command descriptions 559

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

Saved successfully!

Ooh no, something went wrong!