Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
eval(1) OSS Shell and Utilities Reference Manual
NAME
eval - Executes arguments as commands
SYNOPSIS
eval [argument ...]
DESCRIPTION
The arguments to eval are read as input to the shell, and the resulting commands are executed.
eval concatenates the arguments and separates each with a space character.
EXAMPLES
In the following example, values are assigned to variables, and these variables are used as argu-
ments to the eval command. The results of the eval command are printed to the screen by using
the print command.
x=5 y=x
z=’$’$x
print $y
x
eval y=’$’$x
print $y
5
NOTES
• Parameter assignment lists that precede the command remain in effect when the command
completes.
• I/O redirections are processed after parameter assignments.
• Errors cause a script that contains the commands so marked to abort.
The eval command is a shell built-in command. It differs from the regular commands in that it
does not open a new shell process when it executes.
A general discussion of shell built-in commands and a list of the OSS shell built-in commands are
in the reference page for sh(1).
RELATED INFORMATION
Commands: exec(1), sh(1).
3−108 Hewlett-Packard Company 527188-021