diff options
| author | _ov4 <ov4@ov4.org> | 2026-08-12 12:33:58 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-08-12 12:33:58 +0000 |
| commit | 1caf88d333dd6a2b0aff719994dd6c47708c0c76 (patch) | |
| tree | 5cc4042a5b6d17fa0de66fb4452e53b140baac3a | |
| parent | c2d1c8f63504c5ca65c127d6dba4cd7e39399066 (diff) | |
helper
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | output.c | 21 |
3 files changed, 23 insertions, 1 deletions
@@ -74,3 +74,4 @@ myspin mysplit mystop tsh +output @@ -11,7 +11,7 @@ CXX = g++ CXXFLAGS = -std=c++17 -Wall -Wno-write-strings -O2 CC = gcc CFLAGS = -Wall -O2 -FILES = $(TSH) ./myspin ./mysplit ./mystop ./myint +FILES = $(TSH) ./myspin ./mysplit ./mystop ./myint ./output all: $(FILES) diff --git a/output.c b/output.c new file mode 100644 index 0000000..bba2760 --- /dev/null +++ b/output.c @@ -0,0 +1,21 @@ +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> + +int main(int argc, char **argv) +{ + int i, secs; + + if (argc != 2) { + fprintf(stderr, "Usage: %s <n>\n", argv[0]); + exit(0); + } + secs = atoi(argv[1]); + for (i=0; i < secs; i++) + { + printf("%d\n", i); + fflush(stdout); + sleep(1); + } + exit(0); +} |
