prnt now output to STDERR allowing printing in functions returning results on STDOUT

This commit is contained in:
2025-09-24 17:23:22 +02:00
parent 90be985777
commit 834cb9d307

View File

@@ -95,30 +95,30 @@ export On_IWhite='\e[0;107m'
prnt()
{
if [[ $1 == "-n" ]]; then
local echoopt=$1
shift
local echoopt=$1
shift
else
local echoopt=""
local echoopt=""
fi
case $1 in
"I")
local heads="[ ${IGreen}info${DEFAULTFG} ]"
shift
;;
"W")
local heads="[${IYellow}Warning${DEFAULTFG}]"
shift
;;
"E")
local heads="[ ${IRed}ERROR${DEFAULTFG} ]"
shift
;;
"m")
local heads=" "
shift
;;
"I")
local heads="[ ${IGreen}info${DEFAULTFG} ]"
shift
;;
"W")
local heads="[${IYellow}Warning${DEFAULTFG}]"
shift
;;
"E")
local heads="[ ${IRed}ERROR${DEFAULTFG} ]"
shift
;;
"m")
local heads=" "
shift
;;
esac
echo $echoopt -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${heads} $@"
echo $echoopt -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${heads} $@" >&2
unset heads echoopt
}