Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   eval.1p    ( 1 )

построить команду путем объединения аргументов (construct command by concatenating arguments)

Пролог (Prolog)

This manual page is part of the POSIX Programmer's Manual.  The
       Linux implementation of this interface may differ (consult the
       corresponding Linux manual page for details of Linux behavior),
       or the interface may not be implemented on Linux.

Имя (Name)

eval — construct command by concatenating arguments

Синопсис (Synopsis)

eval [argument...]

Описание (Description)

The eval utility shall construct a command by concatenating
       arguments together, separating each with a <space> character.
       The constructed command shall be read and executed by the shell.

Параметры (Options)

None.

Операнды (Operands)

See the DESCRIPTION.

Стандартный ввод (Stdin)

Not used.

Входные файлы (Input files)

None.

Переменные окружения (Environment variables)

None.

Асинхронные события (Asynchronous events)

Default.

Стандартный вывод (Stdout)

Not used.

Стандартный вывод сообщений (Stderr)

The standard error shall be used only for diagnostic messages.

Выходные файлы (Output files)

None.

Расширенное описание (Extended description)

None.

Статус выхода (Exit)

If there are no arguments, or only null arguments, eval shall
       return a zero exit status; otherwise, it shall return the exit
       status of the command defined by the string of concatenated
       arguments separated by <space> characters, or a non-zero exit
       status if the concatenation could not be parsed as a command and
       the shell is interactive (and therefore did not abort).

Последствия ошибок (Consequences of errors)

Default.

The following sections are informative.


Использование в приложениях (Application usage)

Since eval is not required to recognize the "--" end of options
       delimiter, in cases where the argument(s) to eval might begin
       with '-' it is recommended that the first argument is prefixed by
       a string that will not alter the commands to be executed, such as
       a <space> character:

eval " $commands"

or:

eval " $(some_command)"


Примеры (Examples)

foo=10 x=foo
       y='$'$x
       echo $y
       $foo
       eval y='$'$x
       echo $y
       10

Обоснование (Rationale)

This standard allows, but does not require, eval to recognize
       "--".  Although this means applications cannot use "--" to
       protect against options supported as an extension (or errors
       reported for unsupported options), the nature of the eval utility
       is such that other means can be used to provide this protection
       (see APPLICATION USAGE above).

Будущие направления (Future directions)

None.

Смотри также (See also)

Section 2.14, Special Built-In Utilities