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.

env<br />

Exit Values<br />

Portability<br />

v NLSPATH<br />

Related Information<br />

env, sh<br />

See Appendix F for more information.<br />

0 Successful completion<br />

1 Failure due to any of the following:<br />

v Not enough memory<br />

v Name is too long<br />

2 Incorrect command-line argument<br />

126 env found command but could not invoke it<br />

127 env was unable to find command<br />

P<strong>OS</strong>IX.2, X/Open Portability Guide, <strong>UNIX</strong> <strong>System</strong> V.<br />

printenv on Berkeley <strong>UNIX</strong> systems works like env.<br />

eval — Construct a command by concatenating arguments<br />

Format<br />

Description<br />

Examples<br />

eval [argument ...]<br />

tcsh shell: eval argument ...<br />

The shell evaluates each argument as it would for any command. eval then<br />

concatenates the resulting strings, separated by spaces, and evaluates and<br />

executes this string in the current shell environment.<br />

eval in the tcsh shell<br />

In the tcsh shell, eval treats the arguments as input to the shell and executes the<br />

resulting commands in the context of the current shell. This is usually used to<br />

execute commands generated as the result of command or variable substitution,<br />

since parsing occurs before these substitutions. See “tcsh — Invoke a C shell” on<br />

page 626.<br />

The command:<br />

for a in 1 2 3<br />

do<br />

eval x$a=fred<br />

done<br />

sets variables x1, x2, and x3 to fred. Then:<br />

echo $x1 $x2 $x3<br />

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