Signed-off-by: Steven Baltakatei Sandoval <baltakatei@gmail.com>
bufferTOD="$((SECONDS + $bufferTTL))";
lineCount=0;
# Consume stdin to fill buffer until buffer time-of-death (TOD) arrives
bufferTOD="$((SECONDS + $bufferTTL))";
lineCount=0;
# Consume stdin to fill buffer until buffer time-of-death (TOD) arrives
- while read -r line && [[ $SECONDS -lt "$bufferTOD" ]]; do
+ while read -r -t "$bufferTTL" line && [[ $SECONDS -lt "$bufferTOD" ]]; do
# Append line to buffer array
buffer+=("$line");
echo "DEBUG:Processing line:$lineCount";
# Append line to buffer array
buffer+=("$line");
echo "DEBUG:Processing line:$lineCount";