]> git.ipfire.org Git - thirdparty/bash.git/blame - builtins/eval.def
Bash-5.2 patch 26: fix typo when specifying readline's custom color prefix
[thirdparty/bash.git] / builtins / eval.def
CommitLineData
726f6388
JA
1This file is eval.def, from which is created eval.c.
2It implements the builtin "eval" in Bash.
3
a0c0a00f 4Copyright (C) 1987-2016 Free Software Foundation, Inc.
726f6388
JA
5
6This file is part of GNU Bash, the Bourne Again SHell.
7
3185942a
JA
8Bash is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 3 of the License, or
11(at your option) any later version.
726f6388 12
3185942a
JA
13Bash is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
726f6388 17
3185942a
JA
18You should have received a copy of the GNU General Public License
19along with Bash. If not, see <http://www.gnu.org/licenses/>.
726f6388
JA
20
21$PRODUCES eval.c
22
23$BUILTIN eval
24$FUNCTION eval_builtin
25$SHORT_DOC eval [arg ...]
3185942a
JA
26Execute arguments as a shell command.
27
28Combine ARGs into a single string, use the result as input to the shell,
29and execute the resulting commands.
30
31Exit Status:
32Returns exit status of command or success if command is null.
726f6388
JA
33$END
34
ccc6cda3
JA
35#include <config.h>
36#if defined (HAVE_UNISTD_H)
cce855bc
JA
37# ifdef _MINIX
38# include <sys/types.h>
39# endif
40# include <unistd.h>
ccc6cda3
JA
41#endif
42
726f6388 43#include "../shell.h"
ccc6cda3 44#include "bashgetopt.h"
d166f048 45#include "common.h"
726f6388
JA
46
47/* Parse the string that these words make, and execute the command found. */
48int
49eval_builtin (list)
50 WORD_LIST *list;
51{
ccc6cda3
JA
52 if (no_options (list))
53 return (EX_USAGE);
7117c2d2 54 list = loptend; /* skip over possible `--' */
726f6388 55
ec8113b9 56 return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST|SEVAL_NOOPTIMIZE) : EXECUTION_SUCCESS);
726f6388 57}