prnt now output to STDERR allowing printing in functions returning results on STDOUT
This commit is contained in:
@@ -95,30 +95,30 @@ export On_IWhite='\e[0;107m'
|
|||||||
prnt()
|
prnt()
|
||||||
{
|
{
|
||||||
if [[ $1 == "-n" ]]; then
|
if [[ $1 == "-n" ]]; then
|
||||||
local echoopt=$1
|
local echoopt=$1
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
local echoopt=""
|
local echoopt=""
|
||||||
fi
|
fi
|
||||||
case $1 in
|
case $1 in
|
||||||
"I")
|
"I")
|
||||||
local heads="[ ${IGreen}info${DEFAULTFG} ]"
|
local heads="[ ${IGreen}info${DEFAULTFG} ]"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
"W")
|
"W")
|
||||||
local heads="[${IYellow}Warning${DEFAULTFG}]"
|
local heads="[${IYellow}Warning${DEFAULTFG}]"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
"E")
|
"E")
|
||||||
local heads="[ ${IRed}ERROR${DEFAULTFG} ]"
|
local heads="[ ${IRed}ERROR${DEFAULTFG} ]"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
"m")
|
"m")
|
||||||
local heads=" "
|
local heads=" "
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo $echoopt -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${heads} $@"
|
echo $echoopt -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${heads} $@" >&2
|
||||||
|
|
||||||
unset heads echoopt
|
unset heads echoopt
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user