From 409a33614b541a0e80f8ee1cccfa74f5e6741cc0 Mon Sep 17 00:00:00 2001 From: King John Date: Thu, 13 Mar 2025 16:42:06 +0800 Subject: [PATCH] [#7] tests, fix writing to stderr --- tests/scripts/hello | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/scripts/hello b/tests/scripts/hello index bdddc6f..33c93d8 100755 --- a/tests/scripts/hello +++ b/tests/scripts/hello @@ -1,15 +1,10 @@ -#!/bin/bash +#!/bin/sh -read -r +read -r _ -i=0 - -while [[ i -lt 5 ]] +for i in $(seq 0 4) do - echo hello $i "$(date -Is)" - # bash is tricky! this actually writes to 1 instead of 2 - # don't know how to write to 2 in bash - # echo world $i "$(date -Is)" >&2 - i=$((i+1)) + echo "hello ${i} $(date -Iseconds)" + echo "world ${i} $(date -Iseconds)" >&2 sleep 0.5 done