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
FGADM(8)						      System Manager's Manual							  FGADM(8)

NAME
fgadm - filtergen command program SYNOPSIS
fgadm [ check | reload | save | stop ] DESCRIPTION
fgadm is a simple command interface for managing filtergen(8) based packet filters. USAGE
fgadm can be used to stop existing filters (thus turning them off), reload new packet filters, save currently running filters for longevity, and to check filter scripts for errors before reloading. The following commands are accepted by fgadm: check Check the filter script /etc/filtergen/rules.filter for errors. The generated filter will be printed on standard output, and errors printed to standard error. reload Replace the current live packet filter with the one in /etc/filtergen/rules.filter. The script will be tested for errors before reloading. save The current live packet filter will be saved in a distribution-friendly way. On Red Hat systems, this will save the iptables or ipchains firewall that is currently loaded into the kernel to load at boot with the iptables or ipchains initscript. stop This command will flush the current live packet filter out and put it in a default accept mode, thus no firewalling will be in place. This is useful to abort firewalls in an emergency. EXAMPLES
One may find the following sequence of commands useful for making firewall changes on live servers: # at now + 2 min warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh at> fgadm stop at> ^D<EOT> job 53 at 2004-06-07 17:25 # fgadm check # fgadm reload # atq 53 # atrm 53 # fgadm save FILES
/etc/filtergen/rules.filter Packet filter descriptions are read from this file when fgadm is used. /etc/filtergen/fgadm.conf This file alters the behaviour of filtergen as called from fgadm. BUGS
fgadm save does not work on Debian systems with iptables due to a lack of common sense in the iptables package. SEE ALSO
filtergen(8), filter_syntax(5), filter_backends(5) AUTHOR
fgadm was written by Jamie Wilkinson <jaq@spacepants.org> for the filtergen package, to ease maintenance of filtergen-based firewalls. June 7, 2004 FGADM(8)
All times are GMT -4. The time now is 03:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy