blob: b5673894fa0c61ffef6ac757dd852dddef2ac33b [file] [log] [blame]
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001/* 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 Aalto31859422009-01-12 13:36:28 +00006/*
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 Aaltoccc6cda1996-12-23 17:02:34 +000024#include <stdio.h>
25#include "builtins.h"
26#include "shell.h"
27
28necho_builtin (list)
29WORD_LIST *list;
30{
31 print_word_list (list, " ");
32 printf("\n");
33 fflush (stdout);
34 return (EXECUTION_SUCCESS);
35}
36
37char *necho_doc[] = {
Jari Aalto31859422009-01-12 13:36:28 +000038 "Display arguments.",
39 "",
Jari Aaltoccc6cda1996-12-23 17:02:34 +000040 "Print the arguments to the standard ouput separated",
41 "by space characters and terminated with a newline.",
42 (char *)NULL
43};
44
Jari Aaltob72432f1999-02-19 17:11:39 +000045struct builtin necho_struct = {
Jari Aaltoccc6cda1996-12-23 17:02:34 +000046 "echo",
47 necho_builtin,
48 BUILTIN_ENABLED,
49 necho_doc,
50 "echo [args]",
51 0
52};
53