Added echo(1).
This commit is contained in:
parent
b6a0fd0374
commit
867627c085
|
@ -7,6 +7,7 @@ LOCALBINARIES:=\
|
||||||
init \
|
init \
|
||||||
cat \
|
cat \
|
||||||
cp \
|
cp \
|
||||||
|
echo \
|
||||||
rm \
|
rm \
|
||||||
sh \
|
sh \
|
||||||
mxsh \
|
mxsh \
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int startfrom = 1;
|
||||||
|
bool trailingnewline = true;
|
||||||
|
if ( 1 < argc && strcmp(argv[1], "-n") == 0 )
|
||||||
|
{
|
||||||
|
trailingnewline = false;
|
||||||
|
startfrom = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* prefix = "";
|
||||||
|
for ( int i = startfrom; i < argc; i++ )
|
||||||
|
{
|
||||||
|
printf("%s%s", prefix, argv[i]);
|
||||||
|
prefix = " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( trailingnewline ) { printf("\n"); }
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue