yes.c 495 B

123456789101112131415161718192021
  1. /* vim: tabstop=4 shiftwidth=4 noexpandtab
  2. * This file is part of ToaruOS and is released under the terms
  3. * of the NCSA / University of Illinois License - see LICENSE.md
  4. * Copyright (C) 2013 K Lange
  5. *
  6. * yes - Continually print stuff
  7. *
  8. * Continually prints its first argument, followed by a newline.
  9. */
  10. #include <stdio.h>
  11. int main(int argc, char * argv[]) {
  12. char * yes_string = "y";
  13. if (argc > 1) {
  14. yes_string = argv[1];
  15. }
  16. while (1) {
  17. printf("%s\n", yes_string);
  18. }
  19. return 0;
  20. }