Date: Tue, 18 Apr 2006 23:06:07 +0200 From: Stefan Bethke <stb@lassitu.de> To: Eric Anderson <anderson@centtech.com> Cc: freebsd-hackers@freebsd.org, Gordon Bergling <gbergling@0xfce3.net>, cokane@cokane.org Subject: Re: [PATCH] Fancy rc startup style RFC Message-ID: <F9A0FA02-F0EA-4D31-981C-69BF0A034EE8@lassitu.de> In-Reply-To: <44455294.3030101@centtech.com> References: <444515C8.3030406@centtech.com> <20060418203333.GA19094@central.0xfce3.net> <44454D96.3030004@centtech.com> <200604181651.03040.mistry.7@osu.edu> <44455294.3030101@centtech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 18.04.2006 um 22:56 schrieb Eric Anderson: > Anish Mistry wrote: >>> If I could figure out how to make sh do colors, I'd do it. :) >> Is that all? :) >> #!/bin/sh >> ############################################################ >> # Nico Golde <nico(at)ngolde.de> Homepage: http://www.ngolde.de >> # Last change: Mon Feb 16 16:24:41 CET 2004 >> ############################################################ >> for attr in 0 1 4 5 7 ; do >> echo >> "----------------------------------------------------------------" >> printf "ESC[%s;Foreground;Background - \n" $attr >> for fore in 30 31 32 33 34 35 36 37; do >> for back in 40 41 42 43 44 45 46 47; do >> printf '\033[%s;%s;%sm %02s;%02s ' $attr $fore $back >> $fore $back >> done >> printf '\n' >> done >> printf '\033[0m' >> done > > But can you do it without the printf's? That's the key. We don't > have printf until later in the boot process.. echo -e is your friend, see sh(1). $ echo -e '\e[0;32;46m' gives green on cyan in my xterm. Stefan -- Stefan Bethke <stb@lassitu.de> Fon +49 170 346 0140
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F9A0FA02-F0EA-4D31-981C-69BF0A034EE8>