Operating System - HP-UX
1825011 Members
4748 Online
109678 Solutions
New Discussion юеВ

Re: font display question

 
SOLVED
Go to solution
Edgar_10
Frequent Advisor

font display question

hi,

i have a script with a heading "SYSTEM ADMIN MENU", how would i get the heading to be displayed in BOLD?
12 REPLIES 12
Mark Grant
Honored Contributor

Re: font display question

This depends entirely on what you expect the menu to be displayed on however. if your terminals use terminfo and it's set up correctly

"tput bold" will do it

if not, try "tput so" to start standout and "tput se" to end it

Never preceed any demonstration with anything more predictive than "watch this"
Zigor Buruaga
Esteemed Contributor

Re: font display question

Hi,

You could try adding something like this:

BOLD=`tput bold`
RESET=`tput sgr0`

echo "\t\t\t $BOLD SYSTEM ADMIN MENU $RESET \n\n"


Hope this helps.
Kind regards,
Zigor
Edgar_10
Frequent Advisor

Re: font display question

hi mark,

thanks for info, basically what im doin, is when a user telnets to the server,a banner must be displayed in bold!Any ideas how i can get the banner to display in bold?

Thanks mate!
Mark Grant
Honored Contributor

Re: font display question

I'm a bit confused now! Do you want the login message to have bold or the script?

If it is the script, do as the previous poster mentioned

BOLD=`tput bold"
NORMAL=`tput sgr0"

echo "$BOLD SYSTEM ADMIN MENU $NORMAL"

If it is the login message itself that you want bold then you would have to cut and paste the output of "tput bold" intop the /etc/issue file though I have a feeling that telnetd uses a different file for that. I'll see if I can dig up some info on that last bit.
Never preceed any demonstration with anything more predictive than "watch this"
Edgar_10
Frequent Advisor

Re: font display question

hi mark,

apologies for the run around, i actually want my banner file to display in BOLD.The banner file is set-up & works, just not the BOLD font?

Any ideas?

Most appreciated!!
Mark Grant
Honored Contributor

Re: font display question

OK, still a bit confused but much less so :)

Do you mean the stuff that gets output when you log in i.e /etc/motd ? or do you mean that your script uses the "banner" command or do you mean that somewhere in the login process, you want to plug in your script with a bold heading? Sorry I am probably being a bit stupid here but I think there is a simple thing I am missing in your request.

Never preceed any demonstration with anything more predictive than "watch this"
Mark Grant
Honored Contributor

Re: font display question

I think I understand now!

You have a file with that text in it and when that file gets displayed, you want it in bold?

If you can not do something like the following

tput bold
cat my_banner_file
tput sgr0

Then you will actually have to embed the codes in the file. You will have to be confident that everyone who sees it is going to have the same type if terminal though and for this example I'll assume everyone is using vt100 (most do).

in vi edit you file and do "CTRL V" then "Esc" then "[" then "m" before your text. Then after it do "CTRL V"a then "ESC" then "[" then "m".

This sounds nasty and it is :)
Never preceed any demonstration with anything more predictive than "watch this"
Edgar_10
Frequent Advisor

Re: font display question

hi mark,

Ive sorted the script boldness! What i want 2 do now is when I telnet to a server my banner message "AUTHORISED USERS ONLY" must be displayed in BOLD FONT! motd can only occur once logged in, but I want the bold banner displayed before login?

Thanks in advance!
Mark Grant
Honored Contributor

Re: font display question

To do that from telnet, you'll have to edit the inetd.conf entry for telnetd and make it something like

telnetd -b /etc/issue.telnet and then create /etc/issue.telnet with all your own stuff in it
Never preceed any demonstration with anything more predictive than "watch this"
Zigor Buruaga
Esteemed Contributor

Re: font display question

Hi Edgar,

Correct me if I'm wrong, but think that anybody has already answered you in your previous question:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x76bbe508dd85d44e8152a228f6c3a07f,00.html

Have you tested the last reply?

Kind regards,
Zigor
Artyom Voronchihin
Respected Contributor
Solution

Re: font display question

You shoul insert ESC-sequence to you baner file. Open baner file in vi and do foloving:
1.Before text type in edition mode CTRL-V CTRL-[ [ 1m
2. After text type in edition mode CTRL-V CTRL-[ [0m
It must looks like: ^[[1mTEXT^[[0m

ESC-sequences are:
^[[1m - Bold text
^[[4m - Underlined
^[[5m - Flashing
^[[7m - Inversion
^[[0m - Cancel all attributes

"Intel inside" is not a label, it's a warning.
Edgar_10
Frequent Advisor

Re: font display question

EXCELLENT ARTYOM!!!!

You had the correct syntax,thanx, most appreciated