Imported from ../bash-4.0-rc1.tar.gz.
[platform/upstream/bash.git] / examples / loadables / necho.c
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
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
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[] = {
38         "Display arguments.",
39         "",
40         "Print the arguments to the standard ouput separated",
41         "by space characters and terminated with a newline.",
42         (char *)NULL
43 };
44         
45 struct builtin necho_struct = {
46         "echo",
47         necho_builtin,
48         BUILTIN_ENABLED,
49         necho_doc,
50         "echo [args]",
51         0
52 };
53