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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sh<br />

Quoting<br />

found only in FPATH, this file will be read and executed in the current shell<br />

environment (defining the functions contained in the file). The shell will then<br />

execute the function matching the command name. This allows users to use<br />

FPATH for locating functions without the need to identify every function with the<br />

autoload command.<br />

If FPATH is not set, or the command is not found in FPATH, the shell executes<br />

the first matching file found in the PATH directories.<br />

<strong>Command</strong> names can be marked as tracked aliases.The first time you run a<br />

command with a tracked alias, the shell does a normal PATH search. If the search<br />

is successful, the shell remembers the file that it finds. The next time you run a<br />

command with the same name, sh immediately runs the file found on the last PATH<br />

search; there is no new search. This speeds up the time that it takes the shell to<br />

find the appropriate file.<br />

The set –h command tells the shell that all commands should be treated as tracked<br />

aliases. See alias and set for more information.<br />

To let you override the special meaning of certain words or special characters, the<br />

shell provides several quoting mechanisms. In general, you can turn off the special<br />

meaning of any character by putting a backslash (\) in front of the character. This is<br />

called escaping the character.<br />

For example, you can tell the shell to disregard the special meaning of the newline<br />

character by putting a backslash at the very end of a line. The shell ignores the<br />

escaped newline, and joins the next line of input to the end of the current line. In<br />

this way, you can enter long lines in a convenient and readable fashion.<br />

Escaping characters by putting a backslash in front of them is the most direct way<br />

of telling the shell to disregard special meanings. However, it can be awkward and<br />

confusing if you have several characters to escape.<br />

As an alternative, you can put arguments in various types of quotes. Different quote<br />

characters have different “strengths.” The single-quote characters are the strongest.<br />

When you enclose a command-line argument in single-quote characters, the shell<br />

disregards the special meanings of everything inside the single quotes. For<br />

example:<br />

echo<br />

’*’<br />

Double-quote characters are weaker. Inside double quotes, the shell performs<br />

command substitutions (see “<strong>Command</strong> Substitution” on page 563), parameter<br />

substitutions (see “Parameter Substitution” on page 559) and arithmetic<br />

substitutions (see “Arithmetic Substitution” on page 562). The shell does not<br />

perform such substitutions when they appear inside single quotes. You can use the<br />

backslash to escape another character when they appear inside double quotes, but<br />

inside single quotes the shell ignores this special meaning.<br />

The shell treats internal field separator characters (that is, characters in the value of<br />

the IFS variable) literally inside quoted arguments, whether they’re quoted with<br />

double quotes or single quotes. This means that a quoted argument is considered a<br />

single entity, even if it contains IFS characters.<br />

558 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!