B1. | Operating Instructions & command examples |
C1. | Options (group 1) - Run options (page formats, etc) |
C3. | Options (group 2) - Laser printer options |
C4. | Option rules & examples |
C6. | uvlist laser options & PCL5 printer command equivalents |
C7. | Notes re Tray & paper size options |
C8. | Environmental variables for uvlist |
UVLPDEST environmental variable to determine destination | |
C9. | Examples specifying options on uvlist commands |
C10. | Option specification Rules |
D1. | Shell scripts provided for uvlist (uvlp...) |
D2. | uvlp... scripts for printing text files (JCLs,scripts,programs,etc) |
D3. | uvlp... scripts for printing Mainframe reports |
- allowing 132 columns & 66 lines, Portrait or Landscape | |
D4. | uvlp... scripts for printing ALL files in a directory |
E1. | uvlp12 - print a file at 12 cpi & margin offset for 3 hole punching |
E2. | uvlp12D - print Duplex, 12 cpi (used for UV documentation) |
E3. | uvlp13L - print mainframe style COBOL reports Landscape Simplex |
- 13 cpi allows 135 chars wide & 8 lpi allows 66 lines deep | |
E4. | uvlp13LD - print mainframe style COBOL reports Landscape Duplex |
E5. | uvlp18L - print mainframe style COBOL reports Portrait Simplex |
- 18 cpi allows 132 chars wide & 7 lpi allows 66 lines deep |
F1. | uvlpd12 - print all files in directory (at 12 cpi with 3 hole margins) |
G1. | Shell scripts for printing on AUX devices of Unix terminals |
uvlpx - print to the AUX device with options for format & laser setup | |
uvlpx18 - print to the AUX device at 18 cpi |
H1. | Shell scripts for using uvlist on LINE or CHARACTER printers. |
uvlpi1 - sample script with destination hard-coded for line printer | |
- provides many of the uvlist benefits to line printers | |
- page headings, begin/end restarts, seq#, double space, etc |
I1. | Using 'uvlist' as a FILTER to process files. Some useful options are: |
converting control codes to spaces, removing blank lines, converting | |
formfeeds to Linefeeds, expanding tab stops, etc. | |
Two of these are illustrated using the demo file /home/uvadm/tf/tabtest. |
J1. | ibmlist1 - script to print a file with IBM carriage control characters |
- 133 byte records with carriage control in col 1 |
Goto: Begin this document , End this document , UVSI Home-Page
K1. | Alternative method of printing reports on laser printers using uvcopy |
vs uvlist. This method is more work, but allows you to code your own | |
HP PCL5 file of laser printer escape codes for complete flexibility. |
L1. | printPCL5 - print a file of mixed PCL5 printer control codes & data to print |
- converts pseudo escapes '!'s to true escapes x'1B' & ';'s to linefeeds | |
- prepare your escape sequence control file with the editor | |
using '!' exclamations for escapes x'1B' & ';' semi-colons for LineFeeds x'0A' | |
uvcopy printPCL5,fili1=tf/AGMmeetingPCL5 <-- sample command | |
<-- sample data file below: | |
!E!&k2G!&l0320U!&l0048C!(s4101T!(s0060V!(s0001P!(s0003B!(s0000S!&l0001X | |
; AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. |
M1. | printbig2 - print BIG BOLD letters for posters,notices,etc (portrait mode) |
- input data from a pre-edited text file (see printBIG1 solicits input) | |
- use ';' for newline, use ':' for new page | |
- user options for point size, vertical spacing, italics, typeface | |
- for HP PCL5 compatible printers | |
uvcopy printbig2,fili1=tf/AGMmeeting,uop=p60x20 <-- sample command | |
<-- sample data file below: | |
; AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. |
Note |
|
Goto: Begin this document , End this document , UVSI Home-Page
Uvlist will list ascii text files (on stdout by default) but with the main intention of piping to a printer. Several scripts are provided (such as 'uvlp') which include the pipe to the printer, so you can list your text files with a minimum of keystrokes.
Uvlist was developed primarily to list the documentation files of the Vancouver Utility package. These files use the '*eject' pattern (anywhere in the 1st 15 columns) to signal a new page. For duplex printing '*forcepage#odd' will force the next page to be odd. Code '*forcepage#odd' following the '*eject'(ignored if page# already odd). Use '*forcepage#odd' at the begining of major sections within documents.
Uvlist has also proven to be of substantial assistance to customers as a general purpose text file list utility for programs, scripts, documentation, parameter files, etc.
Many options are provided for laser printers, for example you can list 132 column reports on 8 1/2 width paper using the 'uvlp18' script which includes the option to print at 18 characters per inch.
Uvlist will help you get organized & stay organized by allowing you to file your important listings in standard 8 1/2 x 11 3 ring binders & by ensuring that all listings have page headings that identify the file name & the last modification date.
Uvlist saves you the frustration that can occur when you pick up a listing without page headings to identify where it came from & when it was created.
doc/uvlist.doc size=21344 mod=950227 now=950228:1340 ln# 78 pg# 3 ==========================================================================
The uvlist page heading is shown above. Please note that it contains the following vital pieces of information:
1. filename - doc/uvlist.doc (or whatever)
2. file size - size=999999
3. last modification date - mod=yymmdd
4. today's date when printed - now=yymmdd:HHMM
5. line# of 1st line on page - ln#9999
6. page number - pg#999
Goto: Begin this document , End this document , UVSI Home-Page
uvlist file [Run-options] [Laser-options] - command format
uvlist - display the 'help' screen - when no filename is entered, the program displays a help screen showing command format & the various options available
uvlist file - display file contents on the screen - standard output is the default
uvlist file | lp -onobanner -dlaser1 - pipe output to lp spooler with options
uvlp10 file - 'uvlp' scripts call uvlist & pipe to 'lp' (to save keystrokes)
uvlp10 file p60 c12m300 - print 60 lines/page, 12 cpi, margin 300/720" (2 groups of options, space between)
uvlp12 file - same as above, uvlp12 script includes these commonly used options
uvlp12 doc/uvlist.doc b5e8 d1 - print pages 5-8 of this document Duplexed b5 is option to begin on page 5 e8 is option to end on page 8 d1 is option for Duplex (option group 2)
uvlp10 filename - convenient script to print your files at 10 cpi - desired options for margins, lines/page, etc are hard-coded within the script - you could modify these to your preferences or override as shown above
uvlp12 filename - favorite script to print at 12 cpi - 90 characters within 8 1/2 x 11 paper
----------------------------- options ------------------------------------
uvlist file [Run (format) options] [Laser printer options] - command format
Note |
|
Run options |
|
Laser options |
|
Goto: Begin this document , End this document , UVSI Home-Page
uvlist file [Run-options] [Laser-options] - command format ============**************===============
a# |
|
a8 |
|
a999999 |
|
b# |
|
b75 |
|
c1 |
|
c2 |
|
c4 |
|
c8 |
|
c1 |
|
c3 |
|
c5 |
|
c9 |
|
c15 |
|
d1 |
|
d2 |
|
d4 |
|
e# |
|
e85 |
|
f0 |
|
f1-f9 |
|
g# |
|
g3 |
|
Goto: Begin this document , End this document , UVSI Home-Page
h0 |
|
h_ |
|
h1 |
|
h2 |
|
h4 |
|
l1 |
|
l2 |
|
l4 |
|
i1 |
|
j=newpage, |
|
k=altpage, |
|
m10 |
|
n |
|
n2 |
|
n1 |
|
o1 |
|
o2 |
|
Goto: Begin this document , End this document , UVSI Home-Page
p60 |
|
p0 |
|
q### |
|
q135 |
|
r |
|
r0 |
|
r1 |
|
r2 |
|
r4 |
|
s2-s8 |
|
t1-t9 |
|
u1-u9 |
|
v### |
|
v135 |
|
w1 |
|
w2+ |
|
x1 |
|
y### |
|
z1 |
|
z2 |
|
z4 |
|
z8 |
|
Goto: Begin this document , End this document , UVSI Home-Page
uvlist file [Run-options] [Laser-options] - command format ===========================*************=
a2 |
|
a3 |
|
a26 |
|
b0 |
|
b3 |
|
c## |
|
c10 |
|
d0 |
|
d1 |
|
d2 |
|
Note - '*forcepage#odd' is useful with duplex printing to force sections within the document to start on odd page#s - code '*forcepage#odd' following '*eject' (ignored if page# already odd)
f#### |
|
f4099 |
|
i0 |
|
i1 |
|
j-100 |
|
k-100 |
|
Note |
|
l# |
|
l0 |
|
l2 |
|
Goto: Begin this document , End this document , UVSI Home-Page
uvlist file [Run-options] [Laser-options] - command format ===========================*************=
m300 |
|
n000 |
|
o0 |
|
o1 |
|
p62 |
|
s0 |
|
s1 |
|
t0 |
|
t1 |
|
t2 |
|
v8 |
|
x1 |
|
NOTE |
|
Goto: Begin this document , End this document , UVSI Home-Page
The 'uvlist' program inserts a string of PCL5 printer command codes at the begining of the output file to be sent to the laser printer.
uvlist offers a user friendly method of specifying laser printer commands (vs specifying directly in PCL5 codes). For example to print at 12 cpi, you specify uvlist laser option 'c12' vs PCL5 code '!(s12H' where the '!' is an escape code x'1B'.
We have tried to select option letters that represent the printer command better than the actual PCL5 code. Here is the actual table of uvlist laser options & default PCL5 printer command equivalents extracted from uvlist.
The 1st letter in each entry is the uvlist option code. The next 9 bytes is the PCL5 printer command. The '!' is converted to x'1B' & any leading '0's are suppressed before inserting the concatenated string at the begining of the output file.
char pcltbl[][12] = { "x!&l00001X", /* 00 Copies: x1=default */ "m!&l00300U", /* 01 Margin longedge m300 default 300/720" */ "n!&l00000U", /* 02 negative values to offset right on backside */ "j!&l-0100Z", /* 03 negative values move 1st line up both sides */ "k!&l-0100Z", /* 04 Margin shortedge: neg values move up if top */ "t!&l00004H", /* 05 PaperTRAY: &l4H=paper source, see note below */ "a!&l00002A", /* 06 PaperSize: a2=letter, a3=legal, a26=A4 */ "o!&l00000O", /* 07 Orientation: o0=Portrait, o1=Landscape */ "d!&l00000S", /* 08 DUPLEX: d0=off, d1=longedge, d2=shortedge */ "p!&l00063F", /* 09 lines/page: p63 dflt */ "v!&l00008C", /* 10 Vertical motion v8=dflt 8/48" */ "l!&k00002G", /* 11 line termination changed to l from t (now tray) */ "s!(s00000P", /* 12 spacing s0=fixed, s1=proportional */ "c!(s00010H", /* 13 chars/inch: c10 dflt */ "i!(s00000S", /* 14 Italics: i0=off, i1=on */ "b!(s00000B", /* 15 BOLD: b0=off, b3=on */ "f!(s04099T", /* 16 FONT: f4099=courier, see HP book for others */ "" }; /* 17 end of table null entry */
Goto: Begin this document , End this document , UVSI Home-Page
Users may have a problem specifying the desired tray# & paper source, since the codes used may depend on the printer manufacturer.
Here are the tray & paper source codes documented in the HP PCL5 printer command manuals.
uvlist | PCL5 | HP description | my Lexmark Se3455 tray ================================================================== t1 | !&l1H | main paper source | tray#1 t2 | !&l2H | manual feed | tray#2 t3 | !&l3H | envelope feeder | tray#2 t4 | !&l4H | alternate paper source | tray#2 t5 | !&l5H | large paper source | tray#3
a2 | !&l2A | letter size a3 | !&l2A | legal size a26 | !&l2A | A4 (European)
Here is the uvlist command line extracted from the 'uvlp12' script:
uvlist $1 p60 t4c12 | lp $UVLPDEST #<-- extracted from uvlp script #=================================
uvlist $1 p60 a2c12 | lp $UVLPDEST #<-- might change t4 to a2 paper size #=================================
uvlist $1 p60 t-a-c12 | lp $UVLPDEST #<-- might disable uvlist options t&a #=================================== to use front panel settings
Goto: Begin this document , End this document , UVSI Home-Page
You can add these user preferences to your profile (.profile or .bash_profile).
export UVLPDEST=-dlaser1 <-- specify laser printer for uvlp scripts ========================
I recommend you add 'UVLPDEST' to your .profile to specify the destination printer for all 'uvlp' scripts.
export UVLPOPTN="-onobanner" <-- specify options for 'lp' in uvlp scripts ============================
export UVLISTHDR="xxxxx" ======================
UVLISTHDR defines data to be inserted in uvlist page headings, which will appear after the 'now' date & prior to line# & page#.
export UVLISTROP=c4p55z2 ========================
UVLISTROP defines Run options (see page 'C1') that you want pre-selected for all uvlists. You could of course override these on any 1 uvlist call. The above options example means: remove any control codes, 55 lines per page, and generate a FormFeed at the end of each report.
export UVLISTLOP=c12j180m360 ============================
UVLISTLOP defines Laser printer options (see page 'C3') that you want pre- selected for all uvlists. You could of course override on any 1 uvlist call. The above options example means: 12 chars/inch, 180/720" top margin,& 360/720" left margin.
Goto: Begin this document , End this document , UVSI Home-Page
uvlist file [Run format-options] [laser-options] - command format ==================================*************=
uvlist $1 p60h$2 a2o1d1p64j-200k-200m050n-100c12v6,$3 | lp $UVLPOPTN $UVLPDEST ==============================================================================
This example is taken from the 'uvlp12LD' script which could be used to print mainframe reports (132 cols) Landscape on 8 1/2 x 11 paper. Options are explained below:
$1 - filename to be printed
p60h$2 |
|
p60 |
|
group2 options: c12 = 12 cpi = 130 chars across on 11 inch wide v6 = vertical spacing 6/48" (8 lines/inch) d1 = duplex o1 = Landscape orientation (see o3 below for holes other side) j-200 = front long edge margin offset - neg right, pos left *exception* k-200 = back long edge margin offset - neg right, pos left *exception* m050 = front short edge margin offset - neg up, pos down n-100 = back short edge margin offset - neg down, pos up *exception* - - - Landscape Orientation o3 vs o1 - - - o3 = Landscape orientation (for holes on other side) j150 = front short edge margin offset - neg left, pos right k150 = back short edge margin offset - neg left, pos right m-150 = front long edge margin offset - neg down, pos up *exception* n100 = back long edge margin offset - neg up, pos down ,$3 = any additional options specified by user as arg#3
For 5.8 lines per inch, you must specify the option as 'v=5.8'
Integer options (numerics & '-' sign only) may be run together as shown.
If the option requires any other characters, you must use the '=' separator between the option & the value,& you must separate the options with ','s.
See option rule details on the next page ------------------>
Goto: Begin this document , End this document , UVSI Home-Page
---------------------------- option examples -----------------------------
uvlist file [Run format options] [Laser printer options] | lp
uvlist file | lp - no options
uvlist file p50s2 m300 | lp - print 50 lines/page, double space with left margin 300/720 inch
uvlist file k=' /' | lp - specify alternate eject pattern 5 blanks & slash for cobol programs
uvlist file |
|
uvlist file p60h o1m100j-120c14v6 | lp
uvlist file p60,h o1,m100,j-120,c14.5,v=5.9 | lp
Note |
|
uvlist file b50e55 | lp - begin print at pg 50, end at pg 55
uvlist file e3g3 | lp - print 1st 3 pages & last 3 pages in file
Goto: Begin this document , End this document , UVSI Home-Page
The following scripts (based on the uvlist utility) are very useful for printing programs, scripts, or miscellaneous text files when you would like to have page headings & page numbering.
Scripts are provided for various commonly used options such as characters per inch (saves having to key the options & the pipe to the printer).
uvlist tf/test132 p60 c12 | lp -onobanner -dlaser1 <-- the HARD way ==================================================
uvlp12 tf/test132 <-- the EASY way =================
tf/test132 is a test file provided which includes scaled lines as follows: The test lines are 150 columns long, but only 76 cols will show in this documentation at 10 cpi (since the script has options for 3 hole punches).
10 20 30 40 50 60 70 80 90 100 110 120 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
Most of these scripts offset the left margin to allow 3 hole punching & print the 1 line 'uvlist' page heading (as at the top of this page).
You can override the script options using optional arguments 2 & 3
Example: print 55 lines/page, no heading, 15 cpi,& 1 inch left margin:
uvlist tf/test100 p55h c15m720 | lp -onobanner -dlaser1 <-- the HARD way =======================================================
uvlp10 tf/test100 p55h c15m720 <-- the EASY way ==============================
NOTE |
|
Goto: Begin this document , End this document , UVSI Home-Page
Some of the scripts provided are itemized below & you can check for others by listing uvadm/sf directory --> ls -l sf/util/uvlp*
E#. <--------- indicates script listed on following pages --------------> 'L' <---- UPPER case 'L' indicates LANDSCAPE 'D' <---- UPPER case 'D' indicates DUPLEX printing
uvlp10 - print at 10 cpi, 76 chars on 8 1/2" wide (portrait)
E1. | uvlp12 - print at 12 cpi (90 chars on 8 1/2" wide) |
uvlp12v6 - print at 12 cpi & 8 lpi (90 chars across & 80 lines down) note v6 means 6/48" which is 8 lpi
uvlp13 - print at 13 cpi Simplex (100 chars on 8 1/2" wide) uvlpD13 - print at 13 cpi Duplex (100 chars on 8 1/2" wide) - Owen's favorites for scripts & documentation
uvlp14 - print at 14 cpi (108 chars on 8 1/2" wide)
uvlp16 - print at 14 cpi (120 chars on 8 1/2" wide)
uvlp18 - print at 18 cpi (134 chars on 8 1/2" wide)
uvlp20 - print at 18 cpi (150 chars on 8 1/2" wide)
uvlp10L - print LANDSCAPE at 10 cpi (106 chars on 11" wide)
uvlp12L - print LANDSCAPE at 12 cpi (124 chars on 11" wide)
E3. | uvlp13L - Landscape Simplex, 13 cpi, 8 lpi, 135 chars & 66 lines |
uvlp14L - print LANDSCAPE at 14 cpi (148 chars on 11" wide)
uvlp16L - print LANDSCAPE at 16 cpi (160 chars on 11" wide)
uvlp18L - print LANDSCAPE at 18 cpi (180 chars on 11" wide)
uvlp20L - print LANDSCAPE at 18 cpi (200 chars on 11" wide)
uvlp10D - print DUPLEX at 10 cpi (76 chars across & 60 lines down)
E2. | uvlp12D - print DUPLEX at 12 cpi (90 chars across & 60 lines down) |
- used for Vancouver Utilities hard-copy documentation |
E4. | uvlp13LD - Landscape Duplex, 13 cpi, 8 lpi, 135 chars & 66 lines |
uvlp18D - print DUPLEX at 18 cpi & 6 lpi (134 chars & 60 lines)
uvlp12LD - LANDSCAPE & DUPLEX at 12 cpi (90 chars across & 60 lines down)
Goto: Begin this document , End this document , UVSI Home-Page
The following are RECOMMENDED to print MAINFRAME STYLE COBOL reports allowing for 132 characters wide (Landscape at 13 cpi), and 66 lines per page (8 lines/inch if Landscape).
Some scripts inhibit uvlist page headings ('h' option), since COBOL reports already have page headings.
E3. | uvlp13L - Landscape Simplex, 13 cpi, 8 lpi |
- 135 cols wide & 66 lines down on 8 1/2 x 11 |
E4. | uvlp13LD - Landscape Duplex, 13 cpi, 8 lpi |
uvlp13LA - Landscape Automatic - Simplex if lines < 1000, Duplex if lines > 1000
E5. | uvlp18 - Portrait Simplex, 18cpi, 8 lpi |
- 132 cols wide & 66 lines down on 8 1/2 x 11 |
uvlp18D - Portrait Duplex, 18cpi, 7 lpi
uvlp18A - Portrait Automatic - Simplex if lines < 1000, Duplex if lines > 1000
Goto: Begin this document , End this document , UVSI Home-Page
uvlpd - print all files in a directory
F1. | uvlpd12 - print all files in a directory at 12 cpi |
F2. | uvlpd12A - print all files in directory |
- Automatic (Simplex or Duplex) depending on lines <> 300 |
uvlpd18 - print all files in a directory at 18 cpi
uvlpd1p - print all files in directory, but only 1st page of each file
uvlpp - print all files in a directory matching a specified prefix
uvlpp12 - print all files in a directory matching a specified prefix at 12 cpi (vs 10 cpi default)
G1. | uvlpx - print on AUX device of Unix terminal |
G2. | uvlpx18 - print on AUX device of Unix terminal at 18 cpi |
H2. | uvlpi1 - using uvlist on non-laser printers (LINE/CHARACTER printers) |
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlp12 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlp12 - print a file at 12 cpi (90 chars on 8 1/2 x 11) # - pg hdngs with: filename, mod-date, today-date, page#s # - for HP laserjet 4 printers & compatibles # - by Owen Townsend - UV Software Inc - Dec 1994 #Feb01/14 (at Berks) - add option y90 for scale # #usage: uvlp12 filename [group1] [group2] <-- may override default options # ================================= # # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc # - these scripts invokes uvlist & pipe to the spooler # - scriptnames reflect commonly used uvlist options # group1: p60 = 60 lines per page # group2: c12 = 12 cpi = 90 chars across on 8 1/2 " paper # m280 = default margin offset by 280/720 inch (for 3 hole punches) # - see uvlist.doc for the many other HP PCL5 compatible print options # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # if [ -f "$1" ]; then : else echo "ERROR - $1 is not a file"; exit 1; fi # uvlist $1 p60$2 t1c12$3 | lp $UVLPOPTN $UVLPDEST #=============================================== #note - option 't1' for tray 1 (main paper source on my Lexmark t642) # - option 't4' for alternate tray (t2 & t3 are manual & envelope) # - OR use option 'a1' for letter size (& remove tray code) # and relate letter size to tray# via printer control panel #Feb01/14 - add option y90 for scale uvln=$(basename $0) linesbf=$(wc -l $1); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $1 on $UVLPDEST, lines=$lines" exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlp12D - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlp12D - print a file at 12 cpi (90 chars on 8 1/2 x 11) # - DUPLEX mode (new option April 98) # - pg hdngs with: filename, mod-date, today-date, page#s # - for HP laserjet 4 printers & compatibles # #usage: uvlp12D filename [group1] [group2] <-- may override default options # ================================== # # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc # - these scripts invokes uvlist & pipe to the spooler # - see uvlist.doc for many group1(file) & group2(laser printer) options # - these scripts convert group2 options into HP PCL5 escape sequences # - scriptnames reflect commonly used uvlist options, for example: # group1: p60 = 60 lines per page # b50e60 = Begin print at page 50 & End print at page 60 # group2: d1 = duplex mode # c12 = 12 cpi = 90 chars across on 8 1/2 " paper # m280 = default margin offset by 280/720 inch (for 3 hole punches) # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # if [ -f "$1" ]; then : else echo "ERROR - $1 is not a file"; exit 1; fi uvlist $1 p60$2 t4d1c12n-240$3 | lp $UVLPOPTN $UVLPDEST #====================================================== #note - option 't4' for alternate tray on my Lexmark t642 # - option 't1' for main tray #1 (t2 & t3 are manual & envelope) # - I use t4 for script 'uvlp12D' for my Duplex paper <-- this script # - I use t1 for script 'uvlp12' for my Simplex paper <-- alternate uvln=$(basename $0) linesbf=$(wc -l $1); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $1 on $UVLPDEST, lines=$lines" exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlp13L - print a text file, inserting PCL5 codes to print at: # - 13 cpi Landscape SIMPLEX (135 chars on 11" wide) # - 9 lpi (66 lines + 2 headings per page Landscape, in 7 1/2") # - SIMPLEX, see uvlp13LD for DUPLEX # - this script same as 'uvlp13LS' # - for Mainframe reports on Unix/Linux systems # - pg hdngs with: filename, mod-date, today-date, page#s # - for HP laserjet printers & compatibles # #usage: uvlp13L filename [group1] [group2] <-- may override default options # ================================== # # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc # - these scripts invokes uvlist & pipe to the spooler # - see uvlist.doc for many group1(file) & group2(laser printer) options # - these scripts convert group2 options into HP PCL5 escape sequences # - scriptnames reflect commonly used uvlist options, for example: # group1: p66 = 66 lines per page # h = could add option 'h' to inhibit uvlist page headings # (if reports already have page headings) # group2: a2 - letter size paper # o1 = Landscape orientation # m150 = top margin down 150/720" to allow for 3 hole punching # j-120 = left margin offset (negative to move right on Landscape) # c13 = 12 cpi = 135 chars on 11 inch wide # v5.2 = vertical spacing 6/48" = 9 lpi # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # if [ -f "$1" ]; then : else echo "ERROR - $1 is not a file"; exit 1; fi uvlist $1 p66y140v140$2 a2o1p80m150j-200c13v=5.2$3 | lp $UVLPOPTN $UVLPDEST #========================================================================== #Oct2014 - option y140 for column scale, v140 to split lines at 140 uvln=$(basename $0) linesbf=$(wc -l $1); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $1 on $UVLPDEST, lines=$lines" exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlp13LD - print Landscape DUPLEX at 13 cpi horizontal & 9 lpi vertical # (135 chars wide & 66 lines down on 8 1/2 x 11 Landscape) # - for mainframe reports migrated to Unix/Linux systems # - pg hdngs with: filename, mod-date, today-date, page#s # - for HP laserjet PCL5 printers & compatibles # - by Owen Townsend - UV Software Inc - Jan 2001 # #usage: uvlp13LD filename [group1] [group2] <-- may override default options # =================================== # # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc # - these scripts invokes uvlist & pipe to the spooler # - see uvlist.doc for many group1(file) & group2(laser printer) options # - these scripts convert group2 options into HP PCL5 escape sequences # - scriptnames reflect commonly used uvlist options, for example: # grp1: p66 = 66 lines per page # h = could add option 'h' to inhibit uvlist page headings # (if reports already have page headings) # grp2: a2 - letter size paper # d1 = duplex # c13 = 13 cpi = 135 chars across on 11 inch wide # v5.2 = vertical spacing 5.2/48" (9 lines/inch) # o1 = Landscape orientation (see o3 below for holes other side) # j-200 = front long edge margin offset - neg right, pos left *excetion* # k-200 = back long edge margin offset - neg right, pos left *exception* # m050 = front short edge margin offset - neg up, pos down # n-100 = back short edge margin offset - neg down, pos up *exception* # - - - Landscape Orientation o3 vs o1 - - - # o3 = Landscape orientation (for holes on other side) # j150 = front short edge margin offset - neg left, pos right # k150 = back short edge margin offset - neg left, pos right # m-150 = front long edge margin offset - neg down, pos up *exception* # n100 = back long edge margin offset - neg up, pos down # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU if [ ! -f "$1" ]; then echo "ERROR - $1 is not a file"; exit 1; fi # uvlist $1 p66$2 a2o1d1p80j-200k-200m050n-100c13v=5.2,$3 | lp $UVLPOPTN $UVLPDEST #=============================================================================== uvln=$(basename $0) linesbf=$(wc -l $1); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $1 on $UVLPDEST, lines=$lines" exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlp18 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlp18 - print Portrait Simplex at 18 cpi horizontal & 8 lpi vertical # (132 chars across & 88 lines down on 8 1/2 x 11 portrait) # - for HP laserjet 4 printers & compatibles # - print Mainframe reports on 8 1/2 x 11 # #usage: uvlp18 filename [group1] [group2] <-- may override default options # ================================= # # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc # - these scripts invokes uvlist & pipe to the spooler # - see uvlist.doc for group1(file) & group2(laser printer) default options # - these scripts convert group2 options into HP PCL5 escape sequences # - scriptnames reflect commonly used uvlist options, for example: # # group1: p88 = 88 lines per page (but *eject or ^L will occur before) # d1 = reduce multiple blank lines to 1 # $2 - allows additional options on command line, for example: # b50e60 = Begin print at page 50 & End print at page 60 # # group2: a2 = letter size paper # c18 = 18 cpi = 132 chars across on 8 1/2" wide # v=5.6 = vertical spacing = 5.6/48" = 8.2 lines/inch # j000 = top margin offset 000/720" (no change to default) # m300 = left margin offset 300/720 inch (for 3 hole punches) # $3 - allows additions/overrides on command line, for example: # c14 = 14 cpi, modify default 18cpi if you only need 108 chars # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # # if [ -f "$1" ]; then : else echo "ERROR - $1 is not a file"; exit 1; fi uvlist $1 p80d1y150v150$2 a2c18p88j000m300,v=5.6,$3 | lp $UVLPOPTN $UVLPDEST #=========================================================================== #Oct2014 - option y130 for column scale, v130 to split lines at 130 uvln=$(basename $0) linesbf=$(wc -l $1); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $1 on $UVLPDEST, lines=$lines" exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlpd12 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlpd12 - print all files in current directory # - by Owen Townsend - UV Software Inc - MAR95 # for 60 lines max/page, 280/720" margin,& 12 cpi #Sep21/11 - arg4 added for titlepage optns (s2 to space2) # #usage: uvlpd12 directory [grp1-opts] [grp2-opts] [titlepage-opts] # ======================================================== # dir="$1" if [ -d "$dir" ]; then : else echo "usage: uvlpd12 directory "; exit 1; fi # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # # 1st list contents directory filenames of following detail listings dirf=$(echo $dir | tr '/' '_') # tr for tmp/filename ls -l $dir >tmp/$dirf # create list of filenames to be listed cat tmp/$dirf # display list on console uvlp12 tmp/$dirf $4 # print as page 1 of output # cd $dir for fn in * do if [[ -f $fn && ! $fn == *.idx && -s $fn ]] then uvlist $fn p60$2 a2c12$3 | lp $UVLPOPTN $UVLPDEST #================================================= uvln=$(basename $0) linesbf=$(wc -l $fn); linesb=${linesbf% *}; lines=${linesb##* }; echo "$uvln printing $fn on $UVLPDEST, lines=$lines" else echo "$fn bypassed, directory, zero length file, or .idx file" fi done exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlpd12A - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlpd12A - print all files in current directory # - Simplex or Duplex, depending on lines in file > 180 # - 12 cpi, 6 lpi, margins for 3 hole punched # - by Owen Townsend, UV Software, May 2008 # #usage: uvlpd12A filename [grp1-opts] [grp2-opts] - may override dflt optns # ========================================= # dir="$1"; if [ -d "$dir" ]; then : else echo "usage: uvlpd12A directory "; exit 1; fi # uvlpname=$(basename $0) # capture script name # # .profile should specify environmental variables for 'lp', for example: # export UVLPDEST="-dlp0" #<-- destination 'lp0' ("-dLPT1" for SFU) # export UVLPDEST="" #<-- null to use lpadmin default # export UVLPOPTN="-onobanner" #<-- 'nobanner' option for lp # export UVLPOPTN="" #<-- null disable for Windows SFU # # 1st list contents directory filenames of following detail listings dirf=$(echo $dir | tr '/' '_') # tr for tmp/filename ls -l $dir >tmp/$dirf # create list of filenames to be listed cat tmp/$dirf # display list on console uvlp12 tmp/$dirf # print as page 1 of output cd $dir for fn in * do if [[ ! -s $fn || -d $fn ]]; then echo "$fn bypassed, zero length file, or subdir" continue; fi # # capture lines in file to determine Simplex/Duplex linesbf=$(wc -l $fn); linesb=${linesbf% *}; lines=${linesb##* }; if ((lines < 180)); then uvlist $fn p60$2 a2c12$3 | lp $UVLPOPTN $UVLPDEST #=============================================== A=Simplex else uvlist $fn p60$2 a2d1c12n-240$3 | lp $UVLPOPTN $UVLPDEST #====================================================== A=Duplex fi echo "$uvln printing $fn $A on $UVLPDEST, lines=$lines" done exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlpx - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlpx - print to the AUX device on a Unix terminal # - by Owen Townsend, UV Software, Dec 8/95 # - may print any text file # - overcomes 'tipprint' restriction to files defined in TIP/ix # #usage: uvlpx filename [format-options] [printer-options] # ================================================= # #sample#1: uvlpx file1 - default options assume a laser printer # =========== & uvlist will print page headings # (in addition to any headings in file1) # #sample#2: uvlpx file2 i1h - option 'i1' inhibits generating the laser # =============== printer initialization string (HP PCL5) # - option 'h' inibits uvlist page headings # #sample#3: uvlpx file3 i1hb50e55 - options 'b50e55' would reprint pages # ===================== 50 to 55 of file3 # #sample#4: uvlpx file4 h c14m360 - 'i1' not specified for laser printer # ===================== - 'c14' to print at 14 chars per inch # - 'm360' to offset left margin 1/2 inch # - space reqd after 'h' since 'c14m360' # are group 2 options (for laser printer) # # - see complete description of options in uvlist.doc of volume #2 # - you can modify this script or provide alternatives to fit the level # of expertise & requirements of your end users # - if all AUX devices are character printers, you could hard-code # option 'i1' & perhaps option 'h' if reports already have headings # # - script uses 'tput mc5' to redirect stdout to the AUX device # - uses 'tput mc4' to restore stdout to the screen # tput mc5 # redirect stdout to the AUX device uvlist $1 ${2}i1 $3 tput mc4 # restore stdout to the screen exit 0
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlpx18 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlpx18 - print to a LASER AUX device on a Unix terminal # - at 18 cpi to get 132 column reports on 8 1/2 paper # - allowing margins for 3 hole punching # - by Owen Townsend, UV Software, Dec 8/95 # #usage: uvlpx filename # ============== # #note - See detailed explanation of this script in the 'uvlpx' script # or in uvlist.doc of volume $1 of the Vancouver Utilities # - This script has hard-coded options vs uvlpx which accepts # format & printer options for complete flexibility # - format option (group 1) 'h' inibits uvlist page headings # - laser printer options (group 2) 'c18m300' for 18 cpi & 1/2" margin # tput mc5 # redirect stdout to the AUX device uvlist $1 h c18m300 tput mc4 # restore stdout to the screen exit 0
Goto: Begin this document , End this document , UVSI Home-Page
Uvlist can also be used with non-laser printers by using option 'i1' to inhibit sending out the laser printer initialization strings which would drive non-laser printers crazy.
Uvlist can provide many beneficial options to line/character printers
j=xxxxxx - eject pattern (default '*eject' anywhere in cols 1-15) k=yyyyyy - 2nd pattern eject (default *+EJECT anywhere cols 1-80) - eject also occurs on FormFeeds
See sample script 'uvlpi1' for line printers listed on the next page ---->
Goto: Begin this document , End this document , UVSI Home-Page
#!/bin/ksh # uvlpi1 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvlpi1 - print a file on a LINE PRINTER destination 'lp01' # - special version of uvlp for line printer # - using option 'i1' to inhibit laser printer init strings # - uvlist provides hdngs: filename, mod-date, today-date, page#s # & many convenient options (see below) # #usage: uvlpi1 filename [grp1-opts] [grp2-opts] - may override dflt options # ======================================= # # these scripts invokes uvlist & pipe to the spooler # following options are coded below: # i1 = inhibit laser printer escape sequences # p60 = 60 lines per page # # see uvlist.doc for other options you can specify as arg#2, such as: # b100 - begin printing on page 10 # e105 - end printing on page 10 # g3 - print last 3 pages of report # c1 - convert non-printable characters to period # d2 - drop all blank llines # d1 - reduce multi blank lines to 1 # f1 - convert formfeeds to blank lines (f2=2blank lines) # n - sequence# in 1st 5 print positions # s2 - space 2 (s3 for triple space, etc) # j=xxxxxx - eject pattern (default '*eject' anywhere in cols 1-15) # k=yyyyyy - 2nd pattern eject (default *+EJECT anywhere cols 1-80) # - eject also occurs on FormFeeds # #Note - you cannot specify more than 1 filename or use '*' wildcards # - any arg#2 will be considered options # if [ -f "$1" ]; then : else echo "ERROR - $1 is not a file"; exit 1; fi uvlist $1 hi1p63$2 - | lp -onobanner -dlp01 exit 0
Goto: Begin this document , End this document , UVSI Home-Page
Uvlist can be used as a filter to process files using desired options:
c1 - convert any unprintable characters to spaces (or blanks if c2) c1 - convert control codes x00-x1F x80-xFF to spaces except LineFeed c3 - convert control codes to spaces except LineFeed & FormFeed c4 - reduce multiple consecutive control-characters to 1 period c8 - reduce multiple consecutive blanks to 1 blank c15 - combine all 'c' options above (c1+c2+c4+c8 = c15) d1 - reduce multiple consecutive blank lines to 1 blank line d2 - drop all blank lines d4 - inhibit blank pages (if no significant chars between FormFeeds) f1 - convert formfeeds to blank lines t1-t9 - convert TABs to specified number of blanks u1-u9 - expand TABs depending on column position - normal UNIX tab expansion, u4 every 4 cols, u8 every 8 cols
The unix default is to expand tab-stops to multiples of 8. If you prefer a more compact listing you could use uvlist option 'u4' for multiples of 4. This example uses a demo file provided with Vancouver Utilities.
uvlist /home/uvadm/tf/tabtest u4i1h0p0 >tmp/tabtest =================================================== <options>
# tabtest - test file for uvcopy job tabfix1,2,3 (replace tabs w blanks) # - or uvlist options 't' or 'u' (see uvlist.doc in vol 1) # 'vi' or 'lp' will expand the tabs when you examine this file # - the last line below has 1 tab between words & without expansion would # appear as follows (using periods to represent the tabs):
a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhhhh
01234567890123456789012345678901234567890123456789012345678901234567890
a bb ccc dddd eeeee ffffff ggggggg hhhhhhhh =======================================================================
Note1 |
|
Note2 |
|
Note3 |
|
Note4 |
|
Goto: Begin this document , End this document , UVSI Home-Page
This example will convert control codes to spaces & remove blank lines.
uvlist /home/uvadm/tf/tabtest c1d2i1h0p0 >tmp/ctltest =====================================================
# tabtest - test file for uvcopy job tabfix1,2,3 (replace tabs w blanks) # - or uvlist options 't' or 'u' (see uvlist.doc in vol 1) # 'vi' or 'lp' will expand the tabs when you examine this file # - the last line below has 1 tab between words & without expansion would # appear as follows (using periods to represent the tabs):
a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhhhh
01234567890123456789012345678901234567890123456789012345678901234567890
a bb ccc dddd eeeee ffffff ggggggg hhhhhhhh =======================================================================
# tabtest - test file for uvcopy job tabfix1,2,3 (replace tabs w blanks) # - or uvlist options 't' or 'u' (see uvlist.doc in vol 1) # 'vi' or 'lp' will expand the tabs when you examine this file # - the last line below has 1 tab between words & without expansion would # appear as follows (using periods to represent the tabs): a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhhhh 01234567890123456789012345678901234567890123456789012345678901234567890 a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhhhh =======================================================================
Note1 |
|
Note2 |
|
Goto: Begin this document , End this document , UVSI Home-Page
Sometimes you encounter a file with a lot of blank lines & blank spaces within lines that make the listing longer than it needs to be & makes it difficult to read because lines wrap to multiple lines even though the data would fit on 1 line - if we could just compress the multiple blank spaces.
For example, the output of 'utmpdump' (utility to display reboots & logins) has many blank spaces that wrap lines. Here is the command to capture the output.
#1. utmpdump /var/run/utmp >/tmp/utmpdump1 ======================================
[2] [00000] [~~ ] [reboot ] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT] [1] [20021] [~~ ] [runlevel] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT]
[7] [03935] [1 ] [root ] [tty1 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:25 2008 PDT] [7] [03939] [2 ] [uvadm ] [tty2 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:31 2008 PDT]
[7] [03940] [3 ] [uvbak ] [tty3 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:37 2008 PDT] [7] [03951] [4 ] [uvext ] [tty4 ] [ ] [0.0.0.0 ] [Sun Sep 14 09:22:32 2008 PDT]
We can make the listing easier to read by using uvlist as follows:
#2. uvlist /tmp/utmpdump1 c9d1i1hp0 >/tmp/utmpdump2 =============================================== - option 'c9' reduces multi spaces within lines to 1 space - option 'd1' reduces multi blank lines to 1 blank line - options 'i1hp0' always when using uvlist as a filter (to inhibit laser control codes, uvlist page headings,& FormFeeds)
#3a. vi /tmp/utmpdump2 <-- display compressed report with 'vi' =================
#3b. uvlp12 /tmp/utmpdump2 <-- OR list with 'uvlp12', etc =====================
[2] [00000] [~~ ] [reboot ] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT] [1] [20021] [~~ ] [runlevel] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT]
[7] [03935] [1 ] [root ] [tty1 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:25 2008 PDT] [7] [03939] [2 ] [uvadm ] [tty2 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:31 2008 PDT]
[7] [03940] [3 ] [uvbak ] [tty3 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:37 2008 PDT] [7] [03951] [4 ] [uvext ] [tty4 ] [ ] [0.0.0.0 ] [Sun Sep 14 09:22:32 2008 PDT]
Note |
|
Goto: Begin this document , End this document , UVSI Home-Page
# ibmlist1 - print a file with IBM carriage control characters # - 133 byte records with carriage control in col 1 # - by Owen Townsend, UVSI, Dec 8,2005 # # 1. uvcopy ibmlist1,fili1=rpts/reportxx,filo1=tmp/reportxx # ====================================================== # <-- prompts for report disposition (option rop=r1 below) # --> uvlp18 <-- reply to print at 18 cpi (132 cols portrait) # --> uvlp13L <-- reply to print Landscape at 13 cpi (132 cols) # --> <-- OR reply null & print separately as below # # 2. uvlp18 tmp/reportxx <-- print separately # =================== # # Carriage Control characters converted as follows: # ' ' space 1 before --> space 1 after # '0' space 2 before --> space 1 before & 1 after # '-' space 3 before --> space 2 before & 1 after # '+' space 0 before --> space 1 after # '1' skip chnl 1 --> formfeed (home paper) # '2' skip chnl 2 # etc skip ch 3-11 # 'C' skip chnl 12 # # This job does not exactly reproduce the original mainframe report # - it creates a readable report & probably saves some spacing # - it compensates for IBM printers 'space before' vs Unix 'space after' # # ** converting entire directory of files ** # # You can use the 'uvcopyx' script to repeat this 'uvcopy' job, # for each file # rop=r1 # run option r1 to promt for report disposition # # - might reply with uvlp12, uvlp18, uvlp18L, uvlp13LD, etc fili1=?input,typ=RSF,rcs=133 filo1=?output,typ=LSTtd3,rcs=256 @run opn all #
Goto: Begin this document , End this document , UVSI Home-Page
# begin loop to get/process/put records until EOF man20 get fili1,a0 skp> man90 # # test carriage control code & branch to process cmc a0(1),' ' space 1 before ? skp= man60 cmc a0(1),'0' space 2 before ? skp= man32 cmc a0(1),'-' space 3 before ? skp= man33 cmc a0(1),' ' space 0 before ? skp= man60 cmc a0(1),'1' skip chnl 1 before ? skp= man34 skp man33 other - same as space 3 # # space 2 before --> space 1 before & 1 after man32 put filo1,' ' skp man60 # # space 3 before --> space 2 before & 1 after man33 put filo1,x'0A' write LF explicit (+1 LF implicit) skp man60 # # skip to chnl 1 (home paper) man34 add $ca1,1 count FFs cmn $ca1,1 1st FF ? skp= man60 yes - bypass 1st FF put filo1,x'0C' write FormFeed skp man60 # # common point - write data line + 1 space (LF) after man60 put filo1,a1(132) skp man20 # # EOF - close files & end job man90 cls all eoj
Goto: Begin this document , End this document , UVSI Home-Page
This method uses uvcopy (vs uvlist) to concatenate a separate laser printer control file to the data file to be printed. More work, but allows you to code your own HP PCL5 file of laser printer escape codes for complete flexibility.
The 'escape1' uvcopy job & the following printer control files can be used to print reports on 8 1/2 x 11 paper. For example use the following command to test printing Landscape at 13 cpi, 8 lpi, for 132 column reports
uvcopy escape1,fili1=tf/PCL13c8vL,fili2=tf/test132 ==================================================
You would specify your report file in place of 'tf/test132'
tf/test132 is a test file provided which includes scaled lines as follows: The test lines are 150 columns long, but only 90 cols will show in this documentation at 12 cpi.
10 20 30 40 50 60 70 80 90 100 110 120 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
# PCL13c8vL - PCL5 escape sequences to print 13cpi 8lpi Landscape Courier typeface # - use with uvcopy escape1 to prepend on a datafile # - example from https://uvsoftware.ca/uvlist.htm#K1 # uvcopy escaape1,fili1=tf/PCL13c8vL,fili2=tf/test132 # =================================================== # # '!'s converted to true escapes, prepended to a datafile, & printed with lp # !E - reset printer # !&l200U - positive sets longedge margin down 200 decipts (200/720 inch) # !&l-200Z - negative sets shortedge margin right 200 decipoints (200/720 inch) # !&k2G - for UNIX linefeed only vs MSDOS CR/LF # !&l1O - Landscape # !(s13H - 13 cpi # !&l6C - 8 lp (6/48 inch = 8 lines/inch) # !(s4099T - font = courier !E!&l300U!&l-200Z!&k2G!&l1O!&l6C!(s13H!(s4096T
These control files set the margins for 3 hole punching. You can see more details on these printer control files in LASERjobs.doc.
Goto: Begin this document , End this document , UVSI Home-Page
'printPCL5' is a uvcopy job that I use to print notices in BIG BOLD letters. I edit 1 copy with PCL5 codes embedded, but using '!'s to identify PCL5 codes, which will be replaced by x'1B' escapes required by the PCL5 printer.
For example, here is a file that I used to print notices for a half marathon.
# BMOlimoPCL5 - sample input with embedded PCL5 codes to print BIG & BOLD # - stored at $UV/tf/BMOlimoPCL5, print with --> uvcopy printPCL5 !E!&k2G!&l0320U!&l0000Z!&l0000O!&l0024C!(s4101T!(s0024V!(s0001P!(s0003B!(s0000S!&l001X ;Invite to Runners in Yorkwood Hills ;From: Owen Townsend, 4667 Hoskins Rd. ;Tel: 604-980-5434 Email: owen@uvsoftware.ca ;Re: BMO Half Marathon, Sunday May 5 ;Free ride in 14 seat Limo, meet at my unit #4667 ;Leaving at 6AM for 7AM start in QE park ;Join us for the best Half Marathon in Canada # ;;;;Invite to Runners in Yorkwood Hills ;From: Owen Townsend, 4667 Hoskins Rd. ;Tel: 604-980-5434 Email: owen@uvsoftware.ca ;Re: BMO Half Marathon, Sunday May 5 ;Free ride in 14 seat Limo, meet at my unit #4667 ;Leaving at 6AM for 7AM start in QE park ;Join us for the best Half Marathon in Canada
uvcopy printPCL5,fili1=tf/BMOlimoPCL5,uop=c20 =============================================
Goto: Begin this document , End this document , UVSI Home-Page
# printPCL5 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/ # printPCL5 - print a file of mixed PCL5 printer control codes & data to print # - converts pseudo escapes '!'s to true escapes x'1B' & ';'s to linefeeds # - by Owen Townsend, UV Software, Jan26/2019 # # uvcopy printPCL5,fili1=tf/AGMmeetingPCL5,uop=c20 <-- sample command # ================================================ # - converts pseudo escapes to true escapes, writes output to a tmp/... file # & prints using 'lp', option c# to print multiple copies # # ** sample input data file - $UV/tf/AGMmeetingPCL5 ** # !E !&k2G !&l0320U !&l0000Z !&l0000O !&l0048C !(s4101T !(s0060V !(s0001P !(s0003B !(s0000S !&l0001X # ; AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. # ;; AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. # #Notes - see HP PCL5 technical reference at https://www.hp.com/ctg/Manual/bpl13210.pdf # - see concise PCL5 code reference at https://www.pclviewer.com/resources/reference/ # - sample will print 2 notices, cut at midpoint for 2 notices per page # - ';' inserts lineFeeds, so ';;' at begin 2nd line leaves 1 blank line between # - 3 spaces prior to ' AGM Meeting;... to center this shorter line # opr='$jobname - print file with embedded PCL5 codes (default AGMmeetingPCL5)' opr='uop=q1c1 - option defaults' opr=' c1 - 1 copy' uop=q1c1 # option defaults fili1=?tf/AGMmeetingPCL5,typ=LST,rcs=256 #default escape file for test filo1=tmp/$fili1,typ=RSF,rcs=256 #default output @run opn all # begin loop to read control file & convert '!'s to true escapes x'1B' # - bypassing any #comment records (usually only 1 active record) loop get fili1,a0(256) get next line skp> eof (cc set > at EOF cmc a0(1),'#' comment record ? skp= loop yes - bypass, return to get next # scan for no of copies escape sequence & if found, modify the value scn a0(256),'!&l001X' scan for copies escape sequence skp! 1 mvn ax3(3),$uopbc modify value if found # replace all pseudo escapes with true escapes rep a0(256),'!',x'1B' replace escape markers with true escapes rep a0(256),';',x'0A' replace ';' semi-colons with LineFeeds scnr a0(256),!' ' scan from right for non-blank mvn $rl,$rx save length in rgstr 'l' add $rl,1 add 1 to convert dsplcmnt to length put filo1,a0($rl256) skp loop eof cls all sysv1 'lp -onobanner $UVLPDEST $filo1' send outfile to the spooler (UNIX) eoj #
Goto: Begin this document , End this document , UVSI Home-Page
# UVlh - UV Software LetterHead, datafile for uvcopy printPCL5 # - to print UVSW LetterHeads as follows: # # uvcopy printPCL5,fili1=doc/UVlh,uop=c20 <--option c20 for 20 copies # ======================================= # - '!' exclamations will be converted to x'1B' (escapes) # - ';' semi-colons will be converted to x'0A' (Linefeeds) # - 1st 4 lines below draws a box to surround the last 3 lines Name & Address # - uvcopy job scans for '&l001X' & modifies no of copies as per uop=c99 # !E!&l0O!&l01X!&l200u-100Z!&k2G !&a0h0V!*c5400h800v0P !&a25h25V!*c5350h750v1P !&l300u080Z!(s1P!(s30V!(s3B!(s4101T!&l001X; UV Software Inc. !(s12V!&l12C; 4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3 tel: 604-980-5434; Email: owen@uvsoftware.ca Web: https://www.uvsoftware.ca
The above uvcopy job 'printPCL5' prints files with the PCL5 codes embedded.
uvcopy 'printbig2' (listed on the next page) can be used to print any text file - because the job inserts the PCL5 codes, depending on various options for point size, number of copies, etc.
Goto: Begin this document , End this document , UVSI Home-Page
# printbig2 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/ # printbig2 - print BIG BOLD letters for posters,notices,etc # - by Owen Townsend, UV Software, Jan 26/2019 # - input data from a pre-edited text file (see printbig1 solicits input) # - use ';' for newline, use ':' for new page # - user options for point size, vertical spacing, italics, typeface # - for HP PCL5 compatible printers # - see PCL5 code reference at https://www.pclviewer.com/resources/reference/ # printbig1 - Alternate job to solicit data to print (vs data-file input) # # uvcopy printbig2,fili1=tf/AGMmeeting,uop=p30x20 <-- print 30 Point, 20 copies # =============================================== # - reads input tf/AGMmeeting, prepends with PCL5 codes for point size, etc # - writes output to tmp/AGMmeeting & automatically prints (default $UVLPDEST) # # ** sample input data file - $UV/tf/AGMmeeting ** # # AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. # ;;; AGM Meeting;March 03/2019 7PM;Mollie Nye House;940 Lynn Valley Rd. # #Note - sample file will print 2 meeting notices on 8 1/2 x 11 portrait # - to be cut at midpoint for 2 notices per page # - ';' inserts lineFeeds, so ';;;' inserts 3 blank lines between the 2 notices # - 3 spaces prior to ' AGM Meeting;... to center this shorter line # opr='$jobname - print BIG BOLD letters posters,notices,etc (input from pre-edited text file)' opr='sample: AGM Meeting; March 03/2019 7PM; Mollie Nye House; 940 Lynn Valley Rd.' opr='uop=q1p36v24s0t4101x1l0 - option defaults' opr=' p36 - point size, default 36 points (1 point = 1/60 inch) opr=' v24 - vertical motion in 1/48", dflt = v24 (1/2")' opr=' s0 - style default s0=upright, s1=italics,s32=outlined' opr=' t4101 - typeface, default t4101=CG Times (see PCL manual)' opr=' x1 - number of copies, default 1' opr=' l1 - Landscape (vs Portrait l0 default)' uop=q1p36v24s0t4101x1l0 # user options fili1=?tf/AGMmeeting,typ=LST,rcs=256 filo1=tmp/$fili1,typ=RSF,rcs=256 # load table of PCL controls with defaults (will modify from uops) lod=a0(10) !E!&k2G 000 - reset & CR/LF !&l0320U 010 - left margin in DECI-POINTs (1 decipoint = 1/720 inch) !&l0000Z 020 - top margin (better to insert 1 LineFeed ';' before data) !&l0000O 030 - orientation = portrait !&l0024C 040 - vertical motion, option v24 = 1/2 inch !(s4101T 050 - typeface, option t4101 = CG Times !(s0036V 060 - point size 36/72 (1/2) inch (1 POINT = 1/72 inch) !(s0001P 070 - proportional spacing !(s0003B 080 - BOLD !(s0001S 090 - style option i1=italics, dflt i0 (not italics) !&l0001X 100 - number of copies ~~~~~~~~~~
Goto: Begin this document , End this document , UVSI Home-Page
@run opn all open files # modify PCL control sequences from user options man02 tsb o12(1),x'01' Landscape ? skp! man06 mvc a013(4),'0000' modify left margin for Landscape mvc a023(4),'-320' modify top margin for Landscape mvc a033(4),'0001' set code for Landscape (vs Portrait) man06 mvn a043(4),$uopbv option v - vertical spacing mvn a053(4),$uopbt option t - typeface mvn a063(4),$uopbp option p - point size mvn a093(4),$uopbs option s - style (upright, italics) mvn a103(4),$uopbx option x - number of copies # # ensure vertical spacing in 1/48 at least 60% of points 72/inch mvn $ca2,$uopbp point size option mpy $ca2,60 calc 60% div $ca2,100 cmn $uopbv,$ca2 vert spacing => 60% point size ? skp> 1 mvn a43(4),$ca2 no - adjust to 60% # # squeeze control codes together, cnvrt pseudo escapes to true escapes sqz a0(200),' ' squeeze out all blanks rep a0(150),'!',x'1B' replace '!'s with true escapes scn a0(150),'~' determine length of escape sequences putt4 filo1,a0($rx150) # # begin loop to solicit data until null entry man30 get fili1,b0 get input data skp> man90 (cc set > at EOF) cmc b0(1),'#' comment ? skp= man30 yes - bypass, return to get next rep b0(200),';',x'0A' replace semicolons with linefeeds rep b0(200),':',x'0C' replace colons with formfeeds scnr b0(200),>' ' scan for right hand nonblank add $rx,1 +1 to cnvrt dsplcmnt to length put filo1,b0($rx200) write data to output file skp man30 repeat loop until null entry # # EOF - close files, send output to printer,& end job man90 cls filo1 close output file sysv1 'lp -onobanner $UVLPDEST $filo1' send outfile to the spooler (UNIX) eoj end job #
Goto: Begin this document , End this document , UVSI Home-Page