Skip site navigation (1)Skip section navigation (2)
Date:      18 Feb 2000 21:32:27 +0100
From:      naddy@mips.rhein-neckar.de (Christian Weisgerber)
To:        freebsd-questions@freebsd.org
Subject:   Re: echo and ANSI sequences?
Message-ID:  <88ka8r$26cf$1@bigeye.rhein-neckar.de>
References:  <2605.000218@xs4all.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <2605.000218@xs4all.nl>,  <rene@xs4all.nl> wrote:

>   Echo, however, doesn't wanna play. I suspect the parsing of \e
>   doesnt become a 1-byte ESC-character :((

Indeed. Use printf(1).

>         case $1 in
>           (b | black | B | BLACK)
>                 echo \e[0m\]

Even if echo(1) did what you want, you'd need to quote that string
to protect it from interpretation by the shell.

    printf '\033[0m]'

You might also want to investigate how to do this in a terminal-independent
fashion with tput(1).

-- 
Christian "naddy" Weisgerber                  naddy@mips.rhein-neckar.de



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?88ka8r$26cf$1>