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.

Variables<br />

*/*.[chyl]<br />

Matches all .c, .h, .y, and .l files in a subdirectory of the working directory.<br />

~mks/*.ksh<br />

Matches all shell scripts in the home directory of user mks<br />

(see “Directory Substitution” on page 559 for the use of ~).<br />

If no files match the pattern, sh leaves the argument untouched. If the set option –f<br />

or “–o noglob” is in effect, the shell does not perform filename generation.<br />

Attention: Doublebyte characters in a filename may cause problems. For<br />

instance, if you use a doublebyte character in which one of the bytes is a . (dot) or<br />

/ (slash), the file system treats this as part of the pathname.<br />

The shell maintains variables and can expand them where they are used in<br />

command lines; see “Parameter Substitution” on page 559 for details.<br />

A variable name must begin with an uppercase or lowercase letter or an underscore<br />

(_). Subsequent characters in the name, if any, can be uppercase or lowercase<br />

letters, underscores, or digits 0 through 9. You can assign a value to a variable with:<br />

variable=value<br />

For integer variables (see “Options” on page 717 for details), the value may be<br />

specified as an arithmetic expression. For the syntax of an arithmetic expression,<br />

see “Arithmetic Substitution” on page 562.<br />

You can implicitly declare a variable as an array by using a subscript expression<br />

when assigning a value, as in:<br />

variable[arithmetic expression]=value<br />

You can use a subscripted array variable anywhere that the shell allows an ordinary<br />

variable. For the syntax of an arithmetic expression, see “Arithmetic Substitution” on<br />

page 562. Also see typeset, export, and readonly for details about the attributes<br />

of shell variables, and how shell variables can be exported to child processes.<br />

For a list of variables that the shell either sets or understands, see “Shell Variables”<br />

on page 569.<br />

Shell Execution Environments<br />

A shell execution environment is the set of conditions affecting most commands run<br />

within the shell. It consists of:<br />

v Open files<br />

v The working directory (see cd)<br />

v The file creation mask (see umask)<br />

v The traps currently set (see trap)<br />

v The shell parameters (see set and export)<br />

v The shell functions currently defined (see “<strong>Command</strong> Execution” on page 556)<br />

v Options (see set)<br />

A child shell environmentstarts as a duplicate of the shell environment, except that<br />

traps caught by the shell are set to default values in the child shell. Since the child<br />

sh<br />

Chapter 2. Shell command descriptions 567

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

Saved successfully!

Ooh no, something went wrong!