eval

Official Description

The arguments are read as input to the shell, and the resulting command(s) is executed.

Syntax

eval [ arg ... ]

Options

None

Oddities

Evaluates arguments, forms a command, and executes the command.

Example

$ search=num
$ num=17
$ eval print /'$'$search/ | ed – buzz  # $search evals to num, $num evals to 17
integer x=17
$
$ unset num
$ eval print /'$'$search/ | ed - buzz
?
$
				

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.