yes.c 553 B

12345678910111213141516171819202122232425
  1. /* SPDX-License-Identifier: GPL-3.0+ */
  2. /*
  3. * Copyright (C) 2022, 2023 Ferass El Hafidi <vitali64pmemail@protonmail.com>
  4. * Copyright (C) 2022 Ron Nazarov <ron@noisytoot.org>
  5. */
  6. #include <string.h>
  7. #include <stdio.h>
  8. int main(int argc, char *argv[]) {
  9. setvbuf(stdout, NULL, _IONBF, 0);
  10. if (argc > 1) {
  11. if (!strcmp(argv[1], "--")) {
  12. if (--argc == 1) goto yes;
  13. argv = &argv[1];
  14. }
  15. while(1) {
  16. for (int i = 1; i < argc; i++) printf("%s%c", argv[i], i == argc - 1 ? '\n' : ' ');
  17. }
  18. } else {
  19. yes:
  20. while(1) printf("y\n");
  21. }
  22. return 0;
  23. }