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!

BOLD printing a variable in PS1 command 2

Status
Not open for further replies.

pdtak

Technical User
Feb 25, 2008
63
US
I would like to "BOLD" print the hostname in the following statement:

export PS1=$USER"@"$(hostname -s):'$PWD>'

Is there a special character I can put before and after the variable to make it bold or blinking?

Thanks.
 
man tput

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
To elaborate on PHV's posting a little, tput bold will echo the appropriate escape codes for bold text on your current terminal setting, and tput sgr0 will echo the appropriate codes to reset it back to 'normal' text. man terminfo will give you a list of all of the terminal capabilities you can use with tput, although you'll find many are not supported by all terminals.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top