tput smso (bold) ruins formatting

Hi,

I have some very nicely formatted output on a monitor script and I'd like to make one of the fields bold when a threshold is reached but when I do it changes the formatting.

I've tried using tabs to separate the fields and I've tried using printf to force the size of the fields. Below is the printf version:

Whenever either of the variables are bold (using tput) the formatting goes - it's as though the forced width of 31 is ignored.

Is there another way to format my output? Is my printf statement wrong?

Many thanks,

pondlife.

what is the shell you are using
normally I set variables for fonts
eg BOLD=`echo \033[1m`
NORMAL=`echo \033[0m`

and so on
and any text that needs this formatting is preceded with the $BOLD and ends with $NORMAL.
this works for k shell.

in your shell, you could use this

BOLD=`tput smso bold`

and then echo ${BOLD} Your text

Hi linuxpenquin,

Thanks for the reply. I'm using ksh (on Solaris)- I tried the escape character bold/normal you posted but it doesn't seem to work in my shell.

Thanks,

pondlife.