- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Can I lp to a file?
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
Discussions
Forums
Discussions
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
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
11-29-2000 11:25 AM
11-29-2000 11:25 AM
Can I lp to a file?
If I try piping or redirecting the lp output, all I get is the print request-id information, not the actual output from lp.
Is there a way to do this?
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 11:32 AM
11-29-2000 11:32 AM
Re: Can I lp to a file?
Alternatevely you could set up a new printer and modify its model script. Also somewhere in the /var/lp directory.
Hope this helps a bit.
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 11:33 AM
11-29-2000 11:33 AM
Re: Can I lp to a file?
The steps to do this are as follows:
1) create the "device" file as an empty file with:
touch /tmp/printer
2) shut down the scheduler:
/usr/lib/lpshut
3) add the new "printer" to the spooler:
/usr/lib/lpadmin -ddiskfile -mdumb -v/tmp/printer
where "diskfile" is the name of your printer.
4) accept and enable the printer:
/usr/lib/accept diskfile
enable diskfile
5) restart the scheduler :
lpsched
That might work... good luck,
Steffi Jones
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 03:57 PM
11-29-2000 03:57 PM
Re: Can I lp to a file?
cat "$file" ... line to
cat "$file" >> /tmp/your_filename
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 12:48 AM
11-30-2000 12:48 AM
Re: Can I lp to a file?
I can suggest you an other solution, in order to fullfill /var System FS because of the files send by the Unix Spooler in the directory /var/spool/lp/requests/.
You can create an interface script which copy the file send to the spooler (so in /var/spool/lp/requests) to an other directory (FS) and do a special task.
1?) Create a printer with an interface file :
lpadmin -pMYPRINTER -v/dev/null
-i/home/users/shell.sh
The file /home/users/shell.sh in this example could contain lines like this (to catch parameters sent to the spooler)
#!/usr/bin/ksh
i=0
maxi=5
while [ $i -lt $maxi ] do ; shift ; (( i = i + 1)) ; done
files="$*"
for fic in $files
do
# you put your tasks on the files here
done
Here it is
Hope it can help...
P.S : be careful if you want to modify this interface script after printer settings, because the shell is settle in the /etc/lp/interface directory, and got the name of the created printer.