make echo better

This commit is contained in:
2022-06-26 16:34:50 -04:00
parent b3bb6acce9
commit ad8cca39ae
2 changed files with 40 additions and 14 deletions
+2 -3
View File
@@ -1,16 +1,15 @@
#include <sysexits.h>
#include <stddef.h> /* NULL */
#include <unistd.h> /* write(2) */
#include "libio.h" /* fdprint(3) */
int main(int argc, char **argv){
int s;
if(*argv == NULL)
return EX_OSERR;
while(*++argv != NULL){
for(s = 0; *(*argv+s) != '\0'; ++s);
write(1, *argv, s);
fdprint(1, *argv);
if(*(argv+1) != NULL)
write(1, " ", 1);