motd in color
cswiger at mac.com
Tue Dec 21 18:10:35 PST 2004
Valeri Vassiliev wrote:
[ ... ]
> hi, want to to know if its possible to colorize the /etc/motd with
> escape sequences, if yes how ?
If you are willing assume the user is always going to be on a certain terminal
type which supports color, yes, you can certainly add the terminal-specific
ESC sequences to /etc/motd via an editor which supports binary input (emacs
has a hex mode for this, for example).
It's probably not a great idea, though. I'd be more tempted to write a C
program which queried TERMCAP or use curses to deal with color properly if I
thought it was worth the effort in the first place, although some shells (zsh,
maybe bash) also have decent support for color in their scripts.
More information about the freebsd-questions