Ctrl chars in unix strings

Mike Gleason 252u3129 at fergvax.unl.edu
Sun Sep 23 10:55:33 AEST 1990


How can one imbed control characters in a unix string?  Specifically,
I'd like to have my prompt be in boldface.  To do that, I need to insert
an ESC char, which I am pretty sure equals a ctrl-[.  I know it could be
done, because I can write a small C program to do it.  Actually, my
.signature file has my name in boldface, but I discovered a few minutes
ago that something strips out the control chars, and that's why it will
look goofy below.

I've tried things like:

set prompt=" ^[[1m prompt ^[[0m "

(ESC 1 m turns bolding on, ESC 0 m turns it off)

And I've also tried throwing backslashes to see if unix will take the
next char literally, but that usually doesn't work or reports that its
missing a a right ].  e.g. set prompt=" \^[\[1m (etc ".  I've also tried
substituting double quotes with single quotes.
If any unix.wizards out there can help, I'd appreciate an email!


_____________________________________________________________________________
 * [1m Mike Gleason [0m                                    252u3129 at fergvax.unl.edu
 * "Don't you f*ckin' look at me!" -- D. Hopper       cosc006 at unlcdc2.unl.edu



More information about the Comp.unix.questions mailing list