Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
cups-backends
cups-pipe.pl
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cups-pipe.pl of Package cups-backends
#!/usr/bin/perl -w # # CUPS backend for printing to any program via pipe # # Copyright (c) 2003 SuSE Linux AG, Nuernberg, Germany. # # Author: Jiri Srain <jsrain@suse.cz>, 2003 # $scheme = "pipe"; if (@ARGV == 0) { print "file $scheme \"Unknown\" \"Printing to any command via pipe\"\n"; exit 0; } # in case of wrong number of arguments: print usage hint if (@ARGV != 5 && @ARGV != 6) { print STDERR " Usage: pipe job-id user title copies options [file] example for device-URI: 'pipe:/path/to/targetcommand' Install a printqueue with 'lpadmin -p <pipe-printer-name> -v pipe:/</path/to/targetcommand> -E "; exit 1; } if (defined ($ARGV[5])) { $file = $ARGV[5]; } else { $file = "-"; } # get file to which the job is "printed" from device URI, so # so that you can use this backend multiple times, for various # "pipe" printers... $uri = $ENV{"DEVICE_URI"}; $arg = $uri; $arg =~ s/$scheme:(.*)/$1/; $cmdln = "/bin/cat $file | $arg"; if ($> == 0) { $cmdln = "su -c \"$cmdln \" lp"; } my $exit = system ($cmdln); if ($exit != 0) { print STDERR "ERROR: Error occurred while executing $cmdln"; } exit $exit >> 8;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor