eval [argument …]
tcsh shell: eval argument …
The shell evaluates each argument as it would for any command. eval then concatenates the resulting strings, separated by spaces, and evaluates and executes this string in the current shell environment.
In the tcsh shell, eval treats the arguments as input to the shell and executes the resulting commands in the context of the current shell. This action is typically used to execute commands generated as the result of command or variable substitution, since parsing occurs before these substitutions. See tcsh — Invoke a C shell.
for a in 1 2 3
do
eval x$a=fred
done
sets variables x1, x2,
and x3 to fred. Then: echo $x1 $x2 $x3
produces:
fred fred fred
eval is a special built-in shell command.
See Localization for more information.
Otherwise, the exit status of eval is the exit status of the command that eval runs.
POSIX.2, X/Open Portability Guide, UNIX systems.
exec, sh, tcsh