COHERENT manpages

This page displays the COHERENT manpage for eval [Evaluate arguments].

List of available manpages
Index


eval -- Command

Evaluate arguments
eval [token ...]

The shell  normally evaluates each token of an  input line before executing
it.  During  evaluation, the shell  performs parameter, command,  and file-
name pattern substitution.  The shell does not interpret special characters
after performing substitution.

eval  is useful  when an  additional level of  evaluation is  required.  It
evaluates its arguments and treats the result as shell input.  For example,

    A='>file'
    echo a b c $A

simply prints the output

    a b c >file

because `>' has no special meaning after substitution, but

    A='>file'
    eval echo a b c $A

redirects the output

    a b c

to file. Similarly,

    A='$B'
    B='string'
    echo $A
    eval echo $A

prints

    $B
    string

In the first echo the shell performs substitution only once.

The shell executes eval directly.

See Also

commands,
ksh,
sh