HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Captured spoolfiles and stripping printer escape c...
Operating System - HP-UX
1833847
Members
1916
Online
110063
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
02-18-2001 08:30 AM
02-18-2001 08:30 AM
Captured spoolfiles and stripping printer escape codes from captured spoolfiles.
Could somebody advise me on the best way to strip spoolfiles of any printer escape code.
My aim is to be left with just 'clean' text which may be upload from the HP3000 and viewed by something like notepad without garbage.
All suggetions are welcome.
My aim is to be left with just 'clean' text which may be upload from the HP3000 and viewed by something like notepad without garbage.
All suggetions are welcome.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2001 12:54 PM
02-18-2001 12:54 PM
Re: Captured spoolfiles and stripping printer escape codes from captured spoolfiles.
Unfortunately, you would have to write the entire printer's interpreter. In other words, you have to see the escape (easy) then the next character is the major category of the feature. Some are single characters (they're easy) but some are long graphic sequences or huge font files that must be removed from the data file.
The best way to strip these files is to create them without the special codes. If the source of the spool file is from a PC, pick a really simple printer so the special codes are minimized.
Bill Hassell, sysadmin
The best way to strip these files is to create them without the special codes. If the source of the spool file is from a PC, pick a really simple printer so the special codes are minimized.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2001 05:29 PM
02-18-2001 05:29 PM
Re: Captured spoolfiles and stripping printer escape codes from captured spoolfiles.
Hi,
Since all printing goes through the lp command, you can perform the following:
=============================================
# mv /usr/bin/lp /usr/bin/lp.bin
# cat >> /usr/bin/lp
#!/sbin/sh
for file in $*
do
case $file in
'-*') # ignore options;;
*) rcp $file userid@hp3000-server:/spooltexts/$file # replace appropriately. For security reasons you may wish to use scp instead of rcp
esac
done
/usr/bin/lp.bin $*
=============================================
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Since all printing goes through the lp command, you can perform the following:
=============================================
# mv /usr/bin/lp /usr/bin/lp.bin
# cat >> /usr/bin/lp
#!/sbin/sh
for file in $*
do
case $file in
'-*') # ignore options;;
*) rcp $file userid@hp3000-server:/spooltexts/$file # replace appropriately. For security reasons you may wish to use scp instead of rcp
esac
done
/usr/bin/lp.bin $*
=============================================
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2001 05:43 PM
02-18-2001 05:43 PM
Re: Captured spoolfiles and stripping printer escape codes from captured spoolfiles.
Hi,
To elaborate with more clarity, /usr/bin/lp becomes a script. "cat >> /usr/bin/lp" requires "ctrl-d" to be pressed after all the text in the script has been entered. Remember to "chmod ugo+rx /usr/bin/lp" after the /usr/bin/lp script has been created.
To be precise, replace the entire case statement (closing with esac) within the "for loop" with:
========================================
if echo $file|grep '-' >/dev/null 2>/dev/null
then
:
else
rcp $file userid@hp3000-server:/spooltexts/$file
fi
========================================
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
To elaborate with more clarity, /usr/bin/lp becomes a script. "cat >> /usr/bin/lp" requires "ctrl-d" to be pressed after all the text in the script has been entered. Remember to "chmod ugo+rx /usr/bin/lp" after the /usr/bin/lp script has been created.
To be precise, replace the entire case statement (closing with esac) within the "for loop" with:
========================================
if echo $file|grep '-' >/dev/null 2>/dev/null
then
:
else
rcp $file userid@hp3000-server:/spooltexts/$file
fi
========================================
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
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