add red STDERR output
This commit is contained in:
parent
8f254e85f9
commit
67c48188ad
@ -38,3 +38,14 @@ g_syslogtag="g_bash-script:$g_scriptname[$$]"
|
|||||||
# PATH
|
# PATH
|
||||||
[ -d /etc/thinclient/scripts ] && PATH=$PATH:/etc/thinclient/scripts
|
[ -d /etc/thinclient/scripts ] && PATH=$PATH:/etc/thinclient/scripts
|
||||||
|
|
||||||
|
# red STDERR output
|
||||||
|
exec 9>&2
|
||||||
|
exec 8> >(
|
||||||
|
while IFS='' read -r line || [ -n "$line" ]; do
|
||||||
|
echo -e "\033[31m${line}\033[0m"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
function undirect(){ exec 2>&9; }
|
||||||
|
function redirect(){ exec 2>&8; }
|
||||||
|
trap "redirect;" DEBUG
|
||||||
|
PROMPT_COMMAND='undirect;'
|
||||||
|
Loading…
Reference in New Issue
Block a user