From 1cbe13ec167148c76df5030a1a35a7ed6df78a67 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Mon, 6 Jul 2020 18:03:48 +0000 Subject: [PATCH 01/16] feat(unitproc):validateInput:Add time_element type --- unitproc/bktemp-validateInput | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/unitproc/bktemp-validateInput b/unitproc/bktemp-validateInput index ef125ad..2fa7082 100644 --- a/unitproc/bktemp-validateInput +++ b/unitproc/bktemp-validateInput @@ -7,7 +7,7 @@ try() { "$@" || die "cannot $*"; } #o validateInput() { # Desc: Validates Input # Usage: validateInput [str input] [str input type] - # Version: 0.2.2 + # Version: 0.3.0 # Input: arg1: string to validate # arg2: string specifying input type (ex:"ssh_pubkey") # Output: return code 0: if input string matched specified string type @@ -41,6 +41,18 @@ validateInput() { if [[ "$argType" = "integer" ]]; then if [[ "$argInput" =~ ^[[:digit:]]*$ ]]; then return 0; fi; fi; + + ## time element (year, month, week, day, hour, minute, second) + if [[ "$argType" = "time_element" ]]; then + if [[ "$argInput" = "year" ]] || \ + [[ "$argInput" = "month" ]] || \ + [[ "$argInput" = "week" ]] || \ + [[ "$argInput" = "day" ]] || \ + [[ "$argInput" = "hour" ]] || \ + [[ "$argInput" = "minute" ]] || \ + [[ "$argInput" = "second" ]]; then + return 0; fi; fi; + # Return error if no condition matched. return 1; } # Validates strings @@ -76,6 +88,11 @@ keyType="integer"; if validateInput "$testKey" "$keyType"; then echo "Looks like a valid $keyType:\"$testKey\""; else echo "doesn't look like a valid $keyType:\"$testKey\""; fi echo ""; +testKey="year" +keyType="time_element"; +if validateInput "$testKey" "$keyType"; then echo "Looks like a valid $keyType:\"$testKey\""; else echo "doesn't look like a valid $keyType:\"$testKey\""; fi +echo ""; + #==END sample code== # Author: Steven Baltakatei Sandoval (bktei.com) -- 2.30.2 From e9c166c06dca9c644eeecff9788f609db70616cc Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:06:34 +0000 Subject: [PATCH 02/16] feat(unitproc):Add timeNanosec function Returns nanoseconds since 1970-01-01 with 'date'. --- unitproc/bktemp-timeNanosec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 unitproc/bktemp-timeNanosec diff --git a/unitproc/bktemp-timeNanosec b/unitproc/bktemp-timeNanosec new file mode 100644 index 0000000..4e57b21 --- /dev/null +++ b/unitproc/bktemp-timeNanosec @@ -0,0 +1,19 @@ +#!/bin/bash +# Desc: Get timestamp in nanoseconds + +timeNanosec() { + # Desc: Get epoch nanoseconds + # Version 0.1.0 + # Input: (none) + # Output: Nanoseconds since 1970-01-01 + # Depends: date 8 + currentTime="$(date +%s.%N)"; + epochSeconds="$(echo "$currentTime" | cut -d. -f1)"; + fracNanosec="$(echo "$currentTime" | cut -d. -f2)"; + epochNanosec="$(( ("$epochSeconds" * 1000000000) + ("$fracNanosec") ))"; + echo "$epochNanosec"; +} + +#==BEGIN sample code== +echo "It's been $(timeNanosec) nanoseconds since 1970-01-01."; +#==END sample code== -- 2.30.2 From aec895f516d2a2aa055cda4b439156864d08dd7a Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:08:06 +0000 Subject: [PATCH 03/16] fix(unitproc):timeNanosec: minor comment --- unitproc/bktemp-timeNanosec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unitproc/bktemp-timeNanosec b/unitproc/bktemp-timeNanosec index 4e57b21..3614120 100644 --- a/unitproc/bktemp-timeNanosec +++ b/unitproc/bktemp-timeNanosec @@ -3,7 +3,7 @@ timeNanosec() { # Desc: Get epoch nanoseconds - # Version 0.1.0 + # Version 0.1.1 # Input: (none) # Output: Nanoseconds since 1970-01-01 # Depends: date 8 @@ -12,7 +12,7 @@ timeNanosec() { fracNanosec="$(echo "$currentTime" | cut -d. -f2)"; epochNanosec="$(( ("$epochSeconds" * 1000000000) + ("$fracNanosec") ))"; echo "$epochNanosec"; -} +} # Nanoseconds since 1970-01-01 #==BEGIN sample code== echo "It's been $(timeNanosec) nanoseconds since 1970-01-01."; -- 2.30.2 From 5b497be80e49d3b469d3c5f95ba2cb1e67712c26 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:08:45 +0000 Subject: [PATCH 04/16] fix(unitproc):timeNanosec:minor comment with version and author --- unitproc/bktemp-timeNanosec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unitproc/bktemp-timeNanosec b/unitproc/bktemp-timeNanosec index 3614120..0c38cb9 100644 --- a/unitproc/bktemp-timeNanosec +++ b/unitproc/bktemp-timeNanosec @@ -17,3 +17,6 @@ timeNanosec() { #==BEGIN sample code== echo "It's been $(timeNanosec) nanoseconds since 1970-01-01."; #==END sample code== + +# Author: Steven Baltakatei Sandoval +# License: GPLv3+ -- 2.30.2 From d0dc71daab5a11433154932114390b208e3b087f Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:18:27 +0000 Subject: [PATCH 05/16] fix(bkgpslog):timeNanosec:Make internal variables local --- unitproc/bktemp-timeNanosec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unitproc/bktemp-timeNanosec b/unitproc/bktemp-timeNanosec index 0c38cb9..1fe077f 100644 --- a/unitproc/bktemp-timeNanosec +++ b/unitproc/bktemp-timeNanosec @@ -3,10 +3,11 @@ timeNanosec() { # Desc: Get epoch nanoseconds - # Version 0.1.1 + # Version 0.1.2 # Input: (none) # Output: Nanoseconds since 1970-01-01 # Depends: date 8 + local currentTime epochSeconds fracNanosec epochNanosec currentTime="$(date +%s.%N)"; epochSeconds="$(echo "$currentTime" | cut -d. -f1)"; fracNanosec="$(echo "$currentTime" | cut -d. -f2)"; -- 2.30.2 From e9332c6447b2b6cd413e1d66d281786810e988f3 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:34:11 +0000 Subject: [PATCH 06/16] test(unitproc):dateTimeShort:Add sample test of nanoseconds --- unitproc/bktemp-dateTimeShort | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unitproc/bktemp-dateTimeShort b/unitproc/bktemp-dateTimeShort index 6606d77..cabb4ba 100644 --- a/unitproc/bktemp-dateTimeShort +++ b/unitproc/bktemp-dateTimeShort @@ -41,7 +41,9 @@ dateTimeShort(){ echo "The current day and time is :$(dateTimeShort)"; echo "Contact lost with STS-107 on:$(dateTimeShort "2003-02-01T08:59:15-05:00")"; echo "Bitcoin started on :$(dateTimeShort "@1231006505")"; - +testDate="2020-07-07T02:30:11,690097074+00:00"; +echo "This string was generated using 'date --iso-8601=ns':$testDate"; +echo "Using dateTimeShort, it appears as:$(dateTimeShort "$testDate")"; #==END sample code== # Author: Steven Baltakatei Sandoval -- 2.30.2 From 4caeddd71a0f06cdd6d1824e26e2703c9c91866f Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:36:39 +0000 Subject: [PATCH 07/16] chore(unitproc):timeEpochNS:Rename timeNanosec -> timeEpochNS --- unitproc/{bktemp-timeNanosec => bktemp-timeEpochNS} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename unitproc/{bktemp-timeNanosec => bktemp-timeEpochNS} (85%) diff --git a/unitproc/bktemp-timeNanosec b/unitproc/bktemp-timeEpochNS similarity index 85% rename from unitproc/bktemp-timeNanosec rename to unitproc/bktemp-timeEpochNS index 1fe077f..8c0fb08 100644 --- a/unitproc/bktemp-timeNanosec +++ b/unitproc/bktemp-timeEpochNS @@ -1,8 +1,9 @@ #!/bin/bash # Desc: Get timestamp in nanoseconds -timeNanosec() { +timeEpochNS() { # Desc: Get epoch nanoseconds + # Usage: timeEpochNS # Version 0.1.2 # Input: (none) # Output: Nanoseconds since 1970-01-01 @@ -16,7 +17,7 @@ timeNanosec() { } # Nanoseconds since 1970-01-01 #==BEGIN sample code== -echo "It's been $(timeNanosec) nanoseconds since 1970-01-01."; +echo "It's been $(timeEpochNS) nanoseconds since 1970-01-01."; #==END sample code== # Author: Steven Baltakatei Sandoval -- 2.30.2 From 6ed44731ee993aba953a652ac71a57bc21ec1cf5 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 02:59:17 +0000 Subject: [PATCH 08/16] feat(unitproc):timeEpochNS:Add date-string parsing feature --- unitproc/bktemp-timeEpochNS | 47 ++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/unitproc/bktemp-timeEpochNS b/unitproc/bktemp-timeEpochNS index 8c0fb08..33006e5 100644 --- a/unitproc/bktemp-timeEpochNS +++ b/unitproc/bktemp-timeEpochNS @@ -1,23 +1,52 @@ #!/bin/bash # Desc: Get timestamp in nanoseconds +yell() { echo "$0: $*" >&2; } #o Yell, Die, Try Three-Fingered Claw technique +die() { yell "$*"; exit 111; } #o Ref/Attrib: https://stackoverflow.com/a/25515370 +try() { "$@" || die "cannot $*"; } #o timeEpochNS() { # Desc: Get epoch nanoseconds # Usage: timeEpochNS - # Version 0.1.2 - # Input: (none) + # Version 0.2.0 + # Input: arg1: 'date'-parsable timestamp string (optional) # Output: Nanoseconds since 1970-01-01 - # Depends: date 8 - local currentTime epochSeconds fracNanosec epochNanosec - currentTime="$(date +%s.%N)"; - epochSeconds="$(echo "$currentTime" | cut -d. -f1)"; - fracNanosec="$(echo "$currentTime" | cut -d. -f2)"; - epochNanosec="$(( ("$epochSeconds" * 1000000000) + ("$fracNanosec") ))"; - echo "$epochNanosec"; + # Depends: date 8, yell() + # Ref/Attrib: Force base 10 Bash arith with '10#'. https://stackoverflow.com/a/24777667 + local TIME_CURRENT TIME_INPUT TIME_EPOCH_FLOAT TIME_EPOCH_NSFRAC + local TIME_EPOCH_NS + + argTime="$1"; + + # Get Current Time + TIME_CURRENT="$(date --iso-8601=ns)"; # Produce `date`-parsable current timestamp with resolution of 1 nanosecond. + + # Decide to parse current or supplied time + ## Check if time argument empty + if [[ -z "$argTime" ]]; then + ## T: Time argument empty, use current time + TIME_INPUT="$TIME_CURRENT"; + else + ## F: Time argument exists, validate time + if date --date="$argTime" 1>/dev/null 2>&1; then + ### T: Time argument is valid; use it + TIME_INPUT="$argTime"; + else + ### F: Time argument not valid; exit + yell "ERROR:Invalid time argument supplied. Exiting."; exit 1; + fi + fi + # Construct and deliver nanoseconds since 1970-01-01 + TIME_EPOCH_FLOAT="$(date --date="$TIME_INPUT" +%s.%N)"; # Save ssss.NNNNNNNNN + TIME_EPOCH_INT="$(echo "$TIME_EPOCH_FLOAT" | cut -d. -f1)"; # Get ssss + TIME_EPOCH_NSFRAC="$(echo "$TIME_EPOCH_FLOAT" | cut -d. -f2)"; # Get NNNNNNNNN + TIME_EPOCH_NS="$(( (10#"$TIME_EPOCH_INT" * 1000000000) + (10#"$TIME_EPOCH_NSFRAC") ))"; + echo "$TIME_EPOCH_NS"; } # Nanoseconds since 1970-01-01 #==BEGIN sample code== echo "It's been $(timeEpochNS) nanoseconds since 1970-01-01."; +echo "It's been $(timeEpochNS "10 years ago") nanoseconds since 10 years ago."; +echo "It's been $(timeEpochNS "2003-02-01T08:59:15-05:00") nanoseconds since contact lost with STS-107."; #==END sample code== # Author: Steven Baltakatei Sandoval -- 2.30.2 From d5f7b62e90ca8911b2086a2c094d098e062a51bb Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 03:00:53 +0000 Subject: [PATCH 09/16] style(unitproc):timeEpochNS:Minor semicolons --- unitproc/bktemp-timeEpochNS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unitproc/bktemp-timeEpochNS b/unitproc/bktemp-timeEpochNS index 33006e5..449ffbf 100644 --- a/unitproc/bktemp-timeEpochNS +++ b/unitproc/bktemp-timeEpochNS @@ -33,8 +33,8 @@ timeEpochNS() { else ### F: Time argument not valid; exit yell "ERROR:Invalid time argument supplied. Exiting."; exit 1; - fi - fi + fi; + fi; # Construct and deliver nanoseconds since 1970-01-01 TIME_EPOCH_FLOAT="$(date --date="$TIME_INPUT" +%s.%N)"; # Save ssss.NNNNNNNNN TIME_EPOCH_INT="$(echo "$TIME_EPOCH_FLOAT" | cut -d. -f1)"; # Get ssss -- 2.30.2 From f2a58fc8e1dc8080f7a92de274c40625d6459d62 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 03:01:39 +0000 Subject: [PATCH 10/16] style(unitproc):timeEpochNS:Bump ver for last style commit --- unitproc/bktemp-timeEpochNS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unitproc/bktemp-timeEpochNS b/unitproc/bktemp-timeEpochNS index 449ffbf..b0e9a15 100644 --- a/unitproc/bktemp-timeEpochNS +++ b/unitproc/bktemp-timeEpochNS @@ -7,7 +7,7 @@ try() { "$@" || die "cannot $*"; } #o timeEpochNS() { # Desc: Get epoch nanoseconds # Usage: timeEpochNS - # Version 0.2.0 + # Version 0.2.1 # Input: arg1: 'date'-parsable timestamp string (optional) # Output: Nanoseconds since 1970-01-01 # Depends: date 8, yell() -- 2.30.2 From e061c448841eb607d27d59424c267b4d01c23a5f Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 7 Jul 2020 03:19:30 +0000 Subject: [PATCH 11/16] fix(unitproc):timeEpochNS:Use ** for exponent --- unitproc/bktemp-timeEpochNS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unitproc/bktemp-timeEpochNS b/unitproc/bktemp-timeEpochNS index b0e9a15..4c02f23 100644 --- a/unitproc/bktemp-timeEpochNS +++ b/unitproc/bktemp-timeEpochNS @@ -7,7 +7,7 @@ try() { "$@" || die "cannot $*"; } #o timeEpochNS() { # Desc: Get epoch nanoseconds # Usage: timeEpochNS - # Version 0.2.1 + # Version 0.2.2 # Input: arg1: 'date'-parsable timestamp string (optional) # Output: Nanoseconds since 1970-01-01 # Depends: date 8, yell() @@ -39,7 +39,7 @@ timeEpochNS() { TIME_EPOCH_FLOAT="$(date --date="$TIME_INPUT" +%s.%N)"; # Save ssss.NNNNNNNNN TIME_EPOCH_INT="$(echo "$TIME_EPOCH_FLOAT" | cut -d. -f1)"; # Get ssss TIME_EPOCH_NSFRAC="$(echo "$TIME_EPOCH_FLOAT" | cut -d. -f2)"; # Get NNNNNNNNN - TIME_EPOCH_NS="$(( (10#"$TIME_EPOCH_INT" * 1000000000) + (10#"$TIME_EPOCH_NSFRAC") ))"; + TIME_EPOCH_NS="$(( (10#"$TIME_EPOCH_INT" * 10**9) + (10#"$TIME_EPOCH_NSFRAC") ))"; echo "$TIME_EPOCH_NS"; } # Nanoseconds since 1970-01-01 -- 2.30.2 From 045dc2fbfcb6743e9f97e99fa025f3e42c3f8783 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 9 Jul 2020 17:01:22 +0000 Subject: [PATCH 12/16] feat(unitproc):bkFreqWrite:Init script to process stdin --- unitproc/bkFreqWrite | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 unitproc/bkFreqWrite diff --git a/unitproc/bkFreqWrite b/unitproc/bkFreqWrite new file mode 100644 index 0000000..277396e --- /dev/null +++ b/unitproc/bkFreqWrite @@ -0,0 +1,4 @@ +#!/bin/bash +# Desc: Writes stdin to disk every 5 minutes + + -- 2.30.2 From d642682dfeaa0e7788fd3db7b01f92897f7f88e7 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 9 Jul 2020 17:26:45 +0000 Subject: [PATCH 13/16] test(unitproc):bkFreqWrite: Implem. basic mapfile reading --- unitproc/bkFreqWrite | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/unitproc/bkFreqWrite b/unitproc/bkFreqWrite index 277396e..a4ce1d8 100644 --- a/unitproc/bkFreqWrite +++ b/unitproc/bkFreqWrite @@ -1,4 +1,22 @@ #!/bin/bash # Desc: Writes stdin to disk every 5 minutes +yell() { echo "[$(date --iso-8601=ns)]:$0: $*" >&2; } #o Yell, Die, Try Three-Fingered Claw technique +die() { yell "$*"; exit 111; } #o Ref/Attrib: https://stackoverflow.com/a/25515370 +try() { "$@" || die "cannot $*"; } #o +declare -a buffer + +yell "Script started." + +mapfile -s4 -n5 buffer + +yell "Contents of buffer:${buffer[@]}"; + +for element in "${buffer[@]}"; do + echo "$element"; + sleep 1; +done; + +yell "Script completed." +exit 0; -- 2.30.2 From 9988125c56e859f96b9d1a0425e6564dff1d28e5 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 9 Jul 2020 19:41:07 +0000 Subject: [PATCH 14/16] test(unitproc):bkFreqWrite:Rewrote script to use while read --- unitproc/bkFreqWrite | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/unitproc/bkFreqWrite b/unitproc/bkFreqWrite index a4ce1d8..cec372e 100644 --- a/unitproc/bkFreqWrite +++ b/unitproc/bkFreqWrite @@ -5,18 +5,31 @@ yell() { echo "[$(date --iso-8601=ns)]:$0: $*" >&2; } #o Yell, Die, Try Thr die() { yell "$*"; exit 111; } #o Ref/Attrib: https://stackoverflow.com/a/25515370 try() { "$@" || die "cannot $*"; } #o -declare -a buffer +declare -a buffer # Initialize buffer array +scriptTTL="15"; +bufferTTL="5"; -yell "Script started." +magicWriteBuffer() { + printf "%s\n" "${buffer[@]}" >> /dev/shm/$(date +%s)..bkFreqWrite-output.txt; +} -mapfile -s4 -n5 buffer - -yell "Contents of buffer:${buffer[@]}"; - -for element in "${buffer[@]}"; do - echo "$element"; - sleep 1; +bufferRound=0 +# Run until script TTL seconds pass +while [[ $SECONDS -lt "scriptTTL" ]]; do + bufferTOD="$((SECONDS + $bufferTTL))"; + lineCount=0 + # Start and fill buffer until buffer time-of-death (TOD) arrives + while read -r line && [[ $SECONDS -lt "$bufferTOD" ]]; do + # Append line to buffer + buffer+=("$line"); + echo "Processing line:$lineCount"; + echo "Current line :$line"; + echo "buf elem count :${#buffer[@]}"; + ((lineCount++)); + done; + # Export buffer to asynchronous processing. + magicWriteBuffer & + unset buffer; + # Increment buffer round + ((bufferRound++)); done; - -yell "Script completed." -exit 0; -- 2.30.2 From 17fda1d570d4e3b47ef1c13755fa6fc279e7c623 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 9 Jul 2020 19:43:08 +0000 Subject: [PATCH 15/16] style(unitproc):bkFreqWrite:Add boilerplate and semicolons --- unitproc/bkFreqWrite | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/unitproc/bkFreqWrite b/unitproc/bkFreqWrite index cec372e..2111e2c 100644 --- a/unitproc/bkFreqWrite +++ b/unitproc/bkFreqWrite @@ -13,12 +13,12 @@ magicWriteBuffer() { printf "%s\n" "${buffer[@]}" >> /dev/shm/$(date +%s)..bkFreqWrite-output.txt; } -bufferRound=0 +bufferRound=0; # Run until script TTL seconds pass while [[ $SECONDS -lt "scriptTTL" ]]; do bufferTOD="$((SECONDS + $bufferTTL))"; - lineCount=0 - # Start and fill buffer until buffer time-of-death (TOD) arrives + lineCount=0; + # Consume stdin to fill buffer until buffer time-of-death (TOD) arrives while read -r line && [[ $SECONDS -lt "$bufferTOD" ]]; do # Append line to buffer buffer+=("$line"); @@ -33,3 +33,6 @@ while [[ $SECONDS -lt "scriptTTL" ]]; do # Increment buffer round ((bufferRound++)); done; + +# Author: Steven Baltakatei Sandoval +# License: GPLv3+ -- 2.30.2 From 63ef0127440655cb79919949fef6b9523733a528 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 9 Jul 2020 19:44:18 +0000 Subject: [PATCH 16/16] test(unitproc):bkFreqWrite:Add space for future buffer processing --- unitproc/bkFreqWrite | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unitproc/bkFreqWrite b/unitproc/bkFreqWrite index 2111e2c..663c030 100644 --- a/unitproc/bkFreqWrite +++ b/unitproc/bkFreqWrite @@ -10,7 +10,9 @@ scriptTTL="15"; bufferTTL="5"; magicWriteBuffer() { - printf "%s\n" "${buffer[@]}" >> /dev/shm/$(date +%s)..bkFreqWrite-output.txt; + printf "%s\n" "${buffer[@]}" | cat | cat | cat >> /dev/shm/$(date +%s)..bkFreqWrite-output1.txt; + printf "%s\n" "${buffer[@]}" | cat | cat | cat >> /dev/shm/$(date +%s)..bkFreqWrite-output2.txt; + printf "%s\n" "${buffer[@]}" | cat | cat | cat >> /dev/shm/$(date +%s)..bkFreqWrite-output3.txt; } bufferRound=0; -- 2.30.2