From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id D0BE72F35D for ; Mon, 21 Aug 2000 12:01:57 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.8.7/8.8.7) id MAA07023 for axp-list@listman.redhat.com; Mon, 21 Aug 2000 12:01:57 -0400 Received: from max.phys.uu.nl (max.phys.uu.nl [131.211.32.73]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id MAA07010 for ; Mon, 21 Aug 2000 12:01:56 -0400 Received: from itpuu.phys.uu.nl (itpuu.phys.uu.nl [131.211.32.67]) by max.phys.uu.nl (8.9.3/8.9.3/hjm) with ESMTP id SAA13042 for ; Mon, 21 Aug 2000 18:01:54 +0200 (MET DST) Date: Mon, 21 Aug 2000 18:01:54 +0200 (MET DST) From: Reinier Bikker To: axp-list@redhat.com Subject: Re: setcolor equivalent In-Reply-To: <39A14F5B.C7C2F95A@appnet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors Another option is to use escape codes. This makes it possible to change colors within a line of output. Below is the classic example which shows their usage. #!/bin/bash # colorscript: Display ANSI colours. # esc="\033[" echo -n " _ _ _ _ _40 _ _ _ 41_ _ _ _42 _ _ _ 43" echo "_ _ _ 44_ _ _ _45 _ _ _ 46_ _ _ _47 _" for fore in 30 31 32 33 34 35 36 37; do line1="$fore " line2=" " for back in 40 41 42 43 44 45 46 47; do line1="${line1}${esc}${back};${fore}m Normal ${esc}0m" line2="${line2}${esc}${back};${fore};1m Bold ${esc}0m" done echo -e "$line1\n$line2" done Reinier.