summaryrefslogtreecommitdiff
path: root/examples/loadables/necho.c
blob: 521ee2c6df950f845e7c798db1b969cacfce3d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* necho - echo without options or argument interpretation */

/* Sample builtin to be dynamically loaded with enable -f and replace an
   existing builtin. */

#include <stdio.h>
#include "builtins.h"
#include "shell.h"

necho_builtin (list)
WORD_LIST *list;
{
	print_word_list (list, " ");
	printf("\n");
	fflush (stdout);
	return (EXECUTION_SUCCESS);
}

char *necho_doc[] = {
	"Print the arguments to the standard ouput separated",
	"by space characters and terminated with a newline.",
	(char *)NULL
};
	
struct builtin necho_struct = {
	"echo",
	necho_builtin,
	BUILTIN_ENABLED,
	necho_doc,
	"echo [args]",
	0
};