1EVAL(1P)                   POSIX Programmer's Manual                  EVAL(1P)
2
3
4

PROLOG

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

NAME

13       eval — construct command by concatenating arguments
14

SYNOPSIS

16       eval [argument...]
17

DESCRIPTION

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

OPTIONS

24       None.
25

OPERANDS

27       See the DESCRIPTION.
28

STDIN

30       Not used.
31

INPUT FILES

33       None.
34

ENVIRONMENT VARIABLES

36       None.
37

ASYNCHRONOUS EVENTS

39       Default.
40

STDOUT

42       Not used.
43

STDERR

45       The standard error shall be used only for diagnostic messages.
46

OUTPUT FILES

48       None.
49

EXTENDED DESCRIPTION

51       None.
52

EXIT STATUS

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

CONSEQUENCES OF ERRORS

62       Default.
63
64       The following sections are informative.
65

APPLICATION USAGE

67       Since  eval is not required to recognize the "--" end of options delim‐
68       iter, in cases where the argument(s) to eval might begin with '-' it is
69       recommended  that  the first argument is prefixed by a string that will
70       not alter the commands to be executed, such as a <space> character:
71
72           eval " $commands"
73
74       or:
75
76           eval " $(some_command)"
77

EXAMPLES

79       foo=10 x=foo
80       y='$'$x
81       echo $y
82       $foo
83       eval y='$'$x
84       echo $y
85       10
86

RATIONALE

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

FUTURE DIRECTIONS

95       None.
96

SEE ALSO

98       Section 2.14, Special Built-In Utilities
99
101       Portions of this text are reprinted and reproduced in  electronic  form
102       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
103       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
104       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
105       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
106       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
107       event of any discrepancy between this version and the original IEEE and
108       The  Open Group Standard, the original IEEE and The Open Group Standard
109       is the referee document. The original Standard can be  obtained  online
110       at http://www.unix.org/online.html .
111
112       Any  typographical  or  formatting  errors that appear in this page are
113       most likely to have been introduced during the conversion of the source
114       files  to  man page format. To report such errors, see https://www.ker
115       nel.org/doc/man-pages/reporting_bugs.html .
116
117
118
119IEEE/The Open Group                  2013                             EVAL(1P)
Impressum