Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 1 | /* necho - echo without options or argument interpretation */ |
| 2 | |
| 3 | /* Sample builtin to be dynamically loaded with enable -f and replace an |
| 4 | existing builtin. */ |
| 5 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 6 | /* |
| 7 | Copyright (C) 1999-2009 Free Software Foundation, Inc. |
| 8 | |
| 9 | This file is part of GNU Bash. |
| 10 | Bash is free software: you can redistribute it and/or modify |
| 11 | it under the terms of the GNU General Public License as published by |
| 12 | the Free Software Foundation, either version 3 of the License, or |
| 13 | (at your option) any later version. |
| 14 | |
| 15 | Bash is distributed in the hope that it will be useful, |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | GNU General Public License for more details. |
| 19 | |
| 20 | You should have received a copy of the GNU General Public License |
| 21 | along with Bash. If not, see <http://www.gnu.org/licenses/>. |
| 22 | */ |
| 23 | |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 24 | #include <stdio.h> |
| 25 | #include "builtins.h" |
| 26 | #include "shell.h" |
| 27 | |
| 28 | necho_builtin (list) |
| 29 | WORD_LIST *list; |
| 30 | { |
| 31 | print_word_list (list, " "); |
| 32 | printf("\n"); |
| 33 | fflush (stdout); |
| 34 | return (EXECUTION_SUCCESS); |
| 35 | } |
| 36 | |
| 37 | char *necho_doc[] = { |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 38 | "Display arguments.", |
| 39 | "", |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 40 | "Print the arguments to the standard ouput separated", |
| 41 | "by space characters and terminated with a newline.", |
| 42 | (char *)NULL |
| 43 | }; |
| 44 | |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 45 | struct builtin necho_struct = { |
Jari Aalto | ccc6cda | 1996-12-23 17:02:34 +0000 | [diff] [blame] | 46 | "echo", |
| 47 | necho_builtin, |
| 48 | BUILTIN_ENABLED, |
| 49 | necho_doc, |
| 50 | "echo [args]", |
| 51 | 0 |
| 52 | }; |
| 53 | |