Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export COLOR_RED="$(tput setaf 1)"
- export COLOR_RESET="$(tput sgr0)"
- exec 9>&2
- exec 8> >(
- while IFS='' read -r -d $'\0' line || [ -n "$line" ]; do
- echo -ne "${COLOR_RED}${line}${COLOR_RESET}"
- done
- )
- function undirect(){ echo -ne '\0' >&8; exec 2>&9; } # reset to original 9 (==2)
- function redirect(){ exec 2>&8; } # set to custom 8
- trap "redirect;" DEBUG
- PROMPT_COMMAND='undirect;'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement