Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/script/echo.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <stdio.h>

int main (int argc, char** argv) {
  int i=0;
  if (argc>1) {
    if (strcmp(argv[1],"-n")==0) {
      for (i=2; i<argc; i++) {
        fputs(argv[i],stdout);
        if (i+1!=argc) putchar(' ');
      }
    } else {
      for (i=1; i<argc; i++) {
        fputs(argv[i],stdout);
        if (i+1!=argc) putchar(' ');
      }
      putchar('\n');
    }
  } else putchar('\n');
  exit(0);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.