From: Siraaj Khandkar Date: Fri, 3 Aug 2018 17:17:24 +0000 (-0400) Subject: Be a bit more-consistent with while loops X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=15a44039eba31d00dd29c8bed7186b60d8cae1d3;p=khatus.git Be a bit more-consistent with while loops --- diff --git a/bin/khatus b/bin/khatus index f649c87..21d3897 100755 --- a/bin/khatus +++ b/bin/khatus @@ -20,9 +20,11 @@ run_producer() { log="$3" cmd="$4" msg_head="$5" - "$bin"/$cmd | while read line; do - echo "${msg_head} $line" > "$pipe" - done \ + "$bin"/$cmd \ + | while read line + do + echo "${msg_head} $line" > "$pipe" + done \ 2> "$log" # TODO: Perhaps direct log to pipe, so that controller can monitor sensors? } @@ -34,7 +36,7 @@ fork_reactor() { fork_poller() { interval="$1" shift - while true + while : do run_producer "$@" sleep "$interval"