From 1caf88d333dd6a2b0aff719994dd6c47708c0c76 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 12 Aug 2026 12:33:58 +0000 Subject: helper --- .gitignore | 1 + Makefile | 2 +- output.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 output.c diff --git a/.gitignore b/.gitignore index 59c0d35..d448e21 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,4 @@ myspin mysplit mystop tsh +output diff --git a/Makefile b/Makefile index 7e3c0ea..051dbaa 100644 --- a/Makefile +++ b/Makefile @@ -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 +#include +#include + +int main(int argc, char **argv) +{ + int i, secs; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \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); +} -- cgit v1.3.1-4-g156e