Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

colourful or bold shell prompt or echoes

Status
Not open for further replies.

daFranze

Technical User
Dec 29, 2003
1,334
DE
Anybody out there, who knows how to switch echos or prompt to other colours/bold font?

I used to work with Solaris/xterm/tcsh for a verly long time, now I switched to hpux/xterm/(posix-)sh. I am missing a simple way in getting eg. bold prompt, or a echo from a script eg. errors in red, warning in yellow...

Guessing it is not a problem of my xterm, since when I login to a Red Hat 9 Linux machine with bash I see executables coloured in green in the ll output.

I investigated a little bit and found some hints
Code:
colour setting on dt/hpterminals
   green="\033[32m" # switch green on
   bold="\033[1m" # bold
   yellow="\033[33m" # switch yellow on
   red="\033[31m" # red
   blue="\033[34m" # red
   normal="\033[m" # normal; switch color/bold off
   stat="\033[71G" # write at pos 71 (status)
but I don't know how to use this...

Best Regards, Franz
--
UNIX System Manager from Munich, Germany
 
I read some more articles, guessing this does not work with posix shell but with bash...

Best Regards, Franz
--
UNIX System Manager from Munich, Germany
 
echo "\033[1m" # makes the following output bold
echo "\033[22m # switches bold off
tput bold # bold on
tput rmso # bold off

tput smul # underline on
tput rmul # underline off

tput rev # reverse on
tput rmso # reverse off

see the manpages for: tput, terminfo, tic, untic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top