XINU
xsh_echo.c
Go to the documentation of this file.
1 
5 #include <xinu.h>
6 #include <stdio.h>
7 
15 shellcmd xsh_echo(int nargs, char *args[])
16 {
17  int32 i; /* walks through args array */
18 
19  if (nargs > 1)
20  {
21  printf("%s", args[1]);
22 
23  for (i = 2; i < nargs; i++)
24  {
25  printf(" %s", args[i]);
26  }
27  }
28  printf("\n");
29 
30  return 0;
31 }
全てのシステムヘッダファイルをインクルードする。
int32 printf(const char *,...)
Definition: printf.c:13
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
int32 shellcmd
シェルコール関数 返り値の型
Definition: kernel.h:51
shellcmd xsh_echo(int nargs, char *args[])
STDOUT(標準出力)に引数に指定した文字列を出力する。
Definition: xsh_echo.c:15