X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/a22c56b35412f588ce058c85dfeb02d508b6c278..0581fa7805868eef9f6fecf02cb66545b516203d:/unitproc/bktemp-vbm?ds=sidebyside diff --git a/unitproc/bktemp-vbm b/unitproc/bktemp-vbm index c7a82b5..878a022 100644 --- a/unitproc/bktemp-vbm +++ b/unitproc/bktemp-vbm @@ -1,23 +1,29 @@ #!/bin/bash -# Desc: Display message if optionVerbose true +# Desc: Display message if opVerbose true vbm() { - # Description: Prints verbose message ("vbm") to stderr if optionVerbose is set to "true". - # Usage: vbm "DEBUG:verbose message here" - # Version 0.1.0 + # Description: Prints verbose message ("vbm") to stderr if opVerbose is set to "true". + # Usage: vbm "DEBUG :verbose message here" + # Version 0.2.0 # Input: arg1: string - # vars: optionVerbose + # vars: opVerbose # Output: stderr - # Depends: echo + # Depends: bash 5.0.3, echo 8.30, date 8.30 - if [ "$optionVerbose" = "true" ]; then - functionTime=$(date --iso-8601=ns); # Save current time in nano seconds. - echo "[$functionTime] ""$*" 1>&2; # Display argument text. + if [ "$opVerbose" = "true" ]; then + functionTime="$(date --iso-8601=ns)"; # Save current time in nano seconds. + echo "[$functionTime]:$0:""$*" 1>&2; # Display argument text. fi # End function return 0; # Function finished. -} # Verbose message display function. +} # Displays message if opVerbose true + +#==BEGIN sample code== +vbm "STATUS:This is a status message."; +opVerbose="true"; +vbm "STATUS:This is another status message."; +#==END sample code== # Author: Steven Baltakatei Sandoval # License: GPLv3+