- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- lp printing depending on line length
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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-05-2000 11:42 AM
12-05-2000 11:42 AM
lp printing depending on line length
If the line length < 80 I want to print portrait. If the line length < 132 but > 80, I wnat to print landscape. If the line length > 132 I want to use a different printer option.
I know I can write an awk script to print the max length. Any other suggestions?
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2000 11:58 AM
12-05-2000 11:58 AM
Re: lp printing depending on line length
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2000 02:11 PM
12-05-2000 02:11 PM
Re: lp printing depending on line length
if [ `cut -c 80-
then
if [ `cut -c 128-
then
lp -d LINEPRINTER
else
lp -d LANDSCAPE
fi
else
lp -d PORTRAIT
fi
But doing it with awk is more elegant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2000 11:49 PM
12-05-2000 11:49 PM
Re: lp printing depending on line length
wc
awk 'length > 80'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2000 11:59 PM
12-05-2000 11:59 PM
Re: lp printing depending on line length
As 'wc' won't report the longest line length,
'awk' would be a lot more practical to use.
You can use 'fold' as well to fold your lines so that they will fit on your printed document.
Best regards,
Dan