]> git.ipfire.org Git - thirdparty/bash.git/blame - builtins/eval.def
Imported from ../bash-2.05b.tar.gz.
[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
7117c2d2 4Copyright (C) 1987-2002 Free Software Foundation, Inc.
726f6388
JA
5
6This file is part of GNU Bash, the Bourne Again SHell.
7
8Bash is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
bb70624e 10Software Foundation; either version 2, or (at your option) any later
726f6388
JA
11version.
12
13Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
18You should have received a copy of the GNU General Public License along
19with Bash; see the file COPYING. If not, write to the Free Software
bb70624e 20Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
726f6388
JA
21
22$PRODUCES eval.c
23
24$BUILTIN eval
25$FUNCTION eval_builtin
26$SHORT_DOC eval [arg ...]
27Read ARGs as input to the shell and execute the resulting command(s).
28$END
29
ccc6cda3
JA
30#include <config.h>
31#if defined (HAVE_UNISTD_H)
cce855bc
JA
32# ifdef _MINIX
33# include <sys/types.h>
34# endif
35# include <unistd.h>
ccc6cda3
JA
36#endif
37
726f6388 38#include "../shell.h"
ccc6cda3 39#include "bashgetopt.h"
d166f048 40#include "common.h"
726f6388
JA
41
42/* Parse the string that these words make, and execute the command found. */
43int
44eval_builtin (list)
45 WORD_LIST *list;
46{
ccc6cda3
JA
47 if (no_options (list))
48 return (EX_USAGE);
7117c2d2 49 list = loptend; /* skip over possible `--' */
726f6388
JA
50
51 /* Note that parse_and_execute () frees the string it is passed. */
d166f048 52 return (list ? parse_and_execute (string_list (list), "eval", SEVAL_NOHIST) : EXECUTION_SUCCESS);
726f6388 53}