| Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame^] | 1 | This file is eval.def, from which is created eval.c. |
| 2 | It implements the builtin "eval" in Bash. |
| 3 | |
| 4 | Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc. |
| 5 | |
| 6 | This file is part of GNU Bash, the Bourne Again SHell. |
| 7 | |
| 8 | Bash is free software; you can redistribute it and/or modify it under |
| 9 | the terms of the GNU General Public License as published by the Free |
| 10 | Software Foundation; either version 1, or (at your option) any later |
| 11 | version. |
| 12 | |
| 13 | Bash is distributed in the hope that it will be useful, but WITHOUT ANY |
| 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 | for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License along |
| 19 | with Bash; see the file COPYING. If not, write to the Free Software |
| 20 | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | |
| 22 | $PRODUCES eval.c |
| 23 | |
| 24 | $BUILTIN eval |
| 25 | $FUNCTION eval_builtin |
| 26 | $SHORT_DOC eval [arg ...] |
| 27 | Read ARGs as input to the shell and execute the resulting command(s). |
| 28 | $END |
| 29 | |
| 30 | #include "../shell.h" |
| 31 | |
| 32 | /* Parse the string that these words make, and execute the command found. */ |
| 33 | int |
| 34 | eval_builtin (list) |
| 35 | WORD_LIST *list; |
| 36 | { |
| 37 | int result; |
| 38 | |
| 39 | /* Note that parse_and_execute () frees the string it is passed. */ |
| 40 | if (list) |
| 41 | result = parse_and_execute (string_list (list), "eval", -1); |
| 42 | else |
| 43 | result = EXECUTION_SUCCESS; |
| 44 | return (result); |
| 45 | } |