bash - printf colours not working from .bash_logout -
i'm trying use this lovely script on logout ubuntu box i'm ssh'd into. if invoke manually, colours correct. however, whenever it's run .bash_logout, every line white , prefixed colour code:
\x1b[38;5;160;01m .d8888b. 8888888888 8888888888 y88b d88p .d88888b. 888 888 \x1b[38;5;196;01m d88p y88b 888 888 y88b d88p d88p" "y88b 888 888 \x1b[38;5;202;01m "y888b. 8888888 8888888 y888p 888 888 888 888 \x1b[38;5;208;01m "y88b. 888 888 888 888 888 888 888 \x1b[38;5;214;01m "888 888 888 888 888 888 888 888 \x1b[38;5;220;01m y88b d88p 888 888 888 y88b. .d88p y88b. .d88p \x1b[38;5;226;01m "y8888p" 8888888888 8888888888 888 "y88888p" "y88888p"
term set xterm-256color in both vm , host (os x 10.11). tried using echo -e
, did prepend colour string -e
. adding contents of script directly .bash_logout works, though seems messy. thoughts?
in posix shell, cannot use \xxx
escapes in printf
command; can use octal notation. using .
or source
executes script current bash
process instead of using posix shell. bash seeyou
have worked well.
a posix-compliant version of script change first line to:
esc_seq="\033[38;5;"
of course, there no particular reason make code executed .bash_logout
posix-compliant, since file specific bash
.
Comments
Post a Comment