Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Dec 2004 21:10:34 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        Valeri Vassiliev <valeri.ufo@gmail.com>
Cc:        questions@FreeBSD.org
Subject:   Re: motd in color
Message-ID:  <41C8D79A.4000203@mac.com>
In-Reply-To: <b18f7e5c041221170448a992ec@mail.gmail.com>
References:  <b18f7e5c041221170448a992ec@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41C8D79A.4000203>