X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/blobdiff_plain/89de9fb6f72f1a0b3f6cafe0bc310509edccf53a..9d51b1df34711cc609040c0a849bc983155d9b22:/exec/bklog?ds=inline diff --git a/exec/bklog b/exec/bklog index 3af2414..cc807a6 100644 --- a/exec/bklog +++ b/exec/bklog @@ -11,7 +11,7 @@ dirTmpDefault="/dev/shm"; # Default parent of working directory # Script Metadata scriptName="bklog"; # Define basename of script file. -scriptVersion="0.1.31"; # Define version of script. +scriptVersion="0.1.33"; # Define version of script. scriptURL="https://gitlab.com/baltakatei/ninfacyzga-01"; # Define website hosting this script. scriptTimeStartEpoch="$(date +%s)"; # Save start time of script in epoch seconds scriptTimeStart="$(date +%Y%m%dT%H%M%S.%N)"; # YYYYmmddTHHMMSS.NNNNNNNNN @@ -58,7 +58,7 @@ processArguments() { -p | --process-string) optionProcString="true" && argProcStrings+=("$2") && argProcFileExts+=("$3") && vbm "STATUS:file extension \"$3\" for output of processing string added:\"$2\""; shift; shift;; -l | --label) optionLabel="true" && argLabel="$2"; vbm "DEBUG :Custom label received:$argLabel"; shift;; -w | --store-raw) optionStoreRaw="true" && argRawFileExt="$2"; vbm "DEBUG :Raw stdin file extension received:$argRawFileExt"; shift;; - -W | --no-store-raw) optionNoStoreRaw="true"; vbm "DEBUG :Option selected to not store raw stdin data."; + -W | --no-store-raw) optionNoStoreRaw="true"; vbm "DEBUG :Option selected to not store raw stdin data.";; *) yell "ERROR: Unrecognized argument: $1"; yell "STATUS:All arguments:$*"; exit 1;; # Handle unrecognized options. esac shift @@ -1453,7 +1453,11 @@ main() { while read -r -t "$bufferTTL" line && [[ $SECONDS -lt "$bufferTOD" ]]; do # Append line to buffer array buffer+=("$line"); - done; + done < /dev/stdin; + # End script if buffer array empty (ex: EOF found in stdin) + if [[ ${#buffer[@]} -eq 0 ]]; then + yell "ERROR:$fn:Empty array:buffer:${buffer[@]}"; exit 1; + fi; # Mark time for buffer ## Initial time if [[ bufferRound -gt 0 ]]; then