Sponsored Content
Full Discussion: System V printing filter
Top Forums Shell Programming and Scripting System V printing filter Post 303025400 by Ken_Snauffer on Thursday 1st of November 2018 02:25:06 PM
Old 11-01-2018
System V printing filter

First, please excuse my apparent lack of attempt as this is NOT the case. I have attempted to research this for hours and realize I am way out of my league. I am not a programmer, especially in Unix.

I have an old Alpha Unix system with a program that prints to a network printer using the LPR command. Since no one has access to the source code or compiler anymore, re-writing the program seems out of the question. I believe what I am looking for is an if script that takes the standard text being sent to the printer, determines if it should actually print, and prints to the printer or prints to NULL.

In more explanation, the program prints all standard text. 3/4+ of this text is operational codes that mean nothing to anyone here and therefore really do not need printed. The rest of the text is needed and should be printed. All of this text needing printed ALWAYS starts of with the first line exactly equal to " Manual Base Iron Staging Moves " followed by several lines of important information. You may be able to use just the word Manual as the compare word. If the first word is NOT Manual, then the entire print job can be sent to NULL. If it is, then it should be directed to the printer.

AKA:
if print job starts with Manual
then print entire job to printer @icsp1/9100: as defined below
else send print job to Null

Printcap file entry is:

Code:
lp1|1|p1|P1|ctllpr|print1:\
	:af=/usr/adm/lp1acct:\
	:br#9600:\
	:ct=tcp:\
	:fc#0177777:\
	:fs#03:\
	:lf=/usr/adm/lp1err:\
	:lp=@icsp1/9100:\
	:mx#0:\
	:pl#66:\
	:pw#80:\
	:rw:\
	:sd=/usr/spool/lpd1:\
	:sf:\
	:sh:\
	:xc#0177777:\
	:xf=/usr/lbin/xf:\
	:xs#044000:\
	:of=/usr/lbin/pcfof +Cgeneric_text.pcf:\
	:if=/usr/lbin/pcfof +Cgeneric_text.pcf:

If any other information is required, please ask.

Moderator's Comments:
Mod Comment edit by bakunin: Please use CODE-tags, like the ones i have edited in for you. Thank you.

Last edited by bakunin; 11-02-2018 at 12:47 AM..
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to configure the lp system to filter files passed to it

I registered a printer hp123 on Sun Solaris Server. I think my printer is expecting a carriage return and linefeed combination at the end of each line (DOS standard), but unix files only have linefeeds at the end of each line. How can I configure the lp system to filter files passed to it?... (1 Reply)
Discussion started by: simt
1 Replies

2. AIX

printing system with the command lp -d

Hello.. Plz, Any one can help me ? when I execute a printing system with the command lp -d<name of printer>, no result with all printers. I have verified the three processes : qdaemon, lpd, writesrv (No problem). thank's (0 Replies)
Discussion started by: okbainf
0 Replies

3. Shell Programming and Scripting

">" used in system() is not printing into file

I have a problem with the following skript in awk. cat runde.txt |awk '{ if ($5==2) { dataname_v=$1 "_" $4 "_adjust.rad befehl1="gensurf seitenwand... (17 Replies)
Discussion started by: ergy1983
17 Replies

4. Solaris

Solaris printing system migration

Hello folks, I'm currently working on migration of printing system from one server to another (namely from Sol 9 to Sol 10). I would like ask if is possible to manage migration via simple copying /etc/printers.conf file and folder /etc/lp to the new server??? I'm not sure if printers... (2 Replies)
Discussion started by: brusell
2 Replies

5. Shell Programming and Scripting

Filter ONLY lines with non-printing charaters

I have a file contains data with non-printing characters. i have used cat -v filename to display whole data with non-printing characters also. However, i need lines with non-printing characters into seperate file. My file is huge and looks like i have to manully find lines using cat -v filename |... (3 Replies)
Discussion started by: JSKOBS
3 Replies
ln03rof(8)						      System Manager's Manual							ln03rof(8)

NAME
ln03rof, ln05rof, ln06rof, ln07rof, ln08rof, ln09of, ln14of, ps_level1of, ps_level2of - ASCII to PostScript translation filter SYNOPSIS
/usr/lbin/ln03rof [-n login] [-h host] [-w pagewidth] [...] [accounting_file] OPTIONS
Specifies the host name of the job owner. Specifies the amount of indentation. Specifies the page length in lines. Specifies the login name of the job owner Selects the output tray where the printed job will be deposited. Refer to the lpr(1) reference page for more infor- mation. Specifies the page width in columns. If the value is greater than 80 the filter will switch to landscape printing. Selects the input paper tray that supplies paper for the print job. The tray names are printer dependent. Refer to the lpr(1) reference page for more information. Prints the job in a way specified by the sides variable. The available options are: Print only on one side of the sheet. Prints on both sides of the sheet. Prints the page in the way specified by the orientation variable. The available options are: The printed output is parallel to the short side of the page. The printed output is parallel to the long side of the page. Specifies the size of the paper. The available sizes are: letter or A4. This switch is specified after the filter specification in the /etc/printcap file. For example: :if=/usr/lbin/ln03rof -Sa4: The default value is letter. OPERANDS Specifies the file in which accounting information will be recorded. DESCRIPTION
The ln03rof and related filters translate ASCII to PostScript, handles the device dependencies of a PostScript printer and performs some accounting functions. PostScript printers print documents formatted in the PostScript page description language only. The ln03rof_isolatin1 and ln03rof_decmcs filters are alternatives to ln03rof and affect how ASCII documents are printed. They cause the encoding for ISO Latin1 or DEC MCS to be used instead of the Adobe Standard Encoding. The ln03rof filter will not translate PostScript documents. The decision to translate a file is based on the first two characters in the document. If they are %!, the filter assumes the document has already been formatted in PostScript. If the first two characters are not %!, the filter assumes that the document is plain ASCII and translates it into PostScript. The ln03rof filter maintains accounting information only for documents that it translates. The af field in the /etc/printcap file is used to specify the accounting file. It is recommended that the ln03rof filter be specified for both the of and the if fields in the /etc/printcap file. For a description of these fields, see the printcap(4) reference page. Filter Files The following print filters and alternatives are available in /usr/lbin/. ------------------------------------------------------------------------- Adobe DEC MCS ISO Latin 1 Printer ------------------------------------------------------------------------- ln03rof ln03rof_decmcs ln03rof_isolatin1 LN03r ln05rof ln05rof_decmcs ln05rof_isolatin1 DEClaser 2150 ln06rof ln06rof_decmcs ln06rof_isolatin1 DEClaser 2250 ln07rof ln07rof_decmcs ln07rof_isolatin1 DEClaser 1150 ln08rof ln08rof_decmcs ln08rof_isolatin1 DEClaser 3250 ln09of ln09of_decmcs ln09of_isolatin1 DEClaser 5100 ln14of ln14of_decmcs ln14of_isolatin1 DEClaser 3500 ps_level1of ps_level1of_decmcs ps_level1of_iso- PostScript level latin1 1 ps_level2of ps_level2of_decmcs ps_level2of_iso- PostScript level latin1 2 ------------------------------------------------------------------------- EXIT STATUS
Success. An error occurred. ERRORS
The /etc/printcap error log field, lf, specifies the name of the error log file. SEE ALSO
Commands: cancel(1), lpr(1), pr(1), printer(1), lpd(8), pac(8), pcfof(8), thailpof(8) Files: printcap(4) Others: i18n_printing(5) System Administration ln03rof(8)
All times are GMT -4. The time now is 07:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy