HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell script font
Operating System - HP-UX
1834351
Members
1952
Online
110066
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2005 10:17 PM
12-06-2005 10:17 PM
Shell script font
I have done a shell script. I need to change font on certain lines that I output and print them. Need to have a font of 12 on line field , with the other getting 16 and 20. How do i do that.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2005 10:38 PM
12-06-2005 10:38 PM
Re: Shell script font
You can do very little about it.
check man page of tput
check man page of tput
There is no substitute to HARDWORK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2005 11:20 PM
12-06-2005 11:20 PM
Re: Shell script font
For terminal output, the tput command will give you access to the terminfo database and the Curses library. For instance, this:
print "$(tput bold) this is bold$(tput sgr0) this is normal"
will demonstrate the bold or enhanced font on the screen. HOWEVER, terminals do not have different font sizes. You might be using a graphics display such as Xwindows but in a terminal window (such as hpterm, xterm or dtterm), only one font size is allowed as there are terminal characteristics such as COLUMNS and ROWS that would be rendered meaningless with multiple fonts.
To see the list of enhancements that are available to tput, check the (very long) man page fpr terminfo. The attached script will demonstrate the most common terminal enhancements.
Now if your goal is to control printing, the task is possible but quite non-portable. Thdere are hundreds of printer models just from HP and controlling the font (and weight, pitch, interline spacing,etc) requires a technical reference manual for the specific printer. You change fonts with escape sequences but these codes depend a lot on the choice of font, whether the font is proportional and the version of PCL for the printer. For non-HP printers, similar codes exist, or there will be a page description language such as Postscript which will more difficult to write the codes.
Bill Hassell, sysadmin
print "$(tput bold) this is bold$(tput sgr0) this is normal"
will demonstrate the bold or enhanced font on the screen. HOWEVER, terminals do not have different font sizes. You might be using a graphics display such as Xwindows but in a terminal window (such as hpterm, xterm or dtterm), only one font size is allowed as there are terminal characteristics such as COLUMNS and ROWS that would be rendered meaningless with multiple fonts.
To see the list of enhancements that are available to tput, check the (very long) man page fpr terminfo. The attached script will demonstrate the most common terminal enhancements.
Now if your goal is to control printing, the task is possible but quite non-portable. Thdere are hundreds of printer models just from HP and controlling the font (and weight, pitch, interline spacing,etc) requires a technical reference manual for the specific printer. You change fonts with escape sequences but these codes depend a lot on the choice of font, whether the font is proportional and the version of PCL for the printer. For non-HP printers, similar codes exist, or there will be a page description language such as Postscript which will more difficult to write the codes.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 01:51 AM
12-07-2005 01:51 AM
Re: Shell script font
This is a very simple thing to do.
From your script, instead of displaying to the std out, create a file with the .html extension and write in the font control tag items. Then view and print the file from a web browser.
Like the others have said though, printing something to the screen or a terminal or terminal emulator in a different font size isn't going to work. You may be able to do something with one of the X windows scripting languages but I am not sure as I don't use them.
From your script, instead of displaying to the std out, create a file with the .html extension and write in the font control tag items. Then view and print the file from a web browser.
Like the others have said though, printing something to the screen or a terminal or terminal emulator in a different font size isn't going to work. You may be able to do something with one of the X windows scripting languages but I am not sure as I don't use them.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP