uvlist.doc - Documentation Listing Utility - Contents

A1. program description
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

shell scripts provided with preselected options for convenient use

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. 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.
K1. 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

A1. uvlist program description

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

B1. uvlist.doc - Documentation Listing Utility

Command Format & Examples

 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
  • there are 2 kinds of options which may be entered as separate
    strings following the input filename
Run options
  • apply to all types of printers (see below)
Laser options
  • for Hewlett Packard laser printers (or compatibles)
    using the PCL 5 printer control language
  • omit these options if you don't have an HP compatible

Goto:   Begin this document End this document UVSI Home-Page

C1. uvlist options

Run options (group 1)


          uvlist file [Run-options] [Laser-options]   - command format
          ============**************===============
a#
  • ignore Formfeeds withing # bytes from begin file (default 8)
a8
  • default 8, a0 to disable, a1 to ignore FF in 1st byte, etc
a999999
  • ignore all FormFeeds in file if # > filesize
b#
  • begin page#
b75
  • would begin printing at page 75 & continue until EOF
    or until option 'e' page# if specified
c1
  • convert control codes x00-x1F x80-xFF to spaces except LineFeed
c2
  • allow FormFeeds to pass thru & cause page skips
c4
  • reduce multiple consecutive control-characters to 1 period
c8
  • reduce multiple consecutive blanks to 1 blank
c1
  • must be specified to activate any of c2,c4,c8
c3
  • convert control codes to spaces except LineFeeds & Formfeeds
c5
  • convert multi consecutive control codes to 1 '.' period
c9
  • convert multi consecutive blanks to 1 ' ' blank
c15
  • combine all 'c' options above (c1+c2+c4+c8 = c15)
d1
  • reduce multiple contiguous blank lines to 1
d2
  • drop all blank lines
d4
  • drop blank pages (if no significant data between FormFeeds)
e#
  • end page#
e85
  • would end print at page# 85 (or EOF if before pg 85)
f0
  • convert FormFeeds to blanks
f1-f9
  • convert each FormFeed to specified no of LineFeeds
g#
  • print specified no of pages from end-of-file
g3
  • print the last 3 pages in the file
  • may use with option 'e', but not with option 'b'
    (e3g3 prints 1st 3 pages & last 3 pages of file)

Goto:   Begin this document End this document UVSI Home-Page

C2. uvlist options (continued)

h0
  • inhibit page headings (see top of this page)
h_
  • page headings will print with selected fields inhibited
    depending on option h1,h2,h4 & l1,l2,l4 as follows:
h1
  • inhibits the module size (default)
h2
  • inhibits the 'mod' date (date of last modification)
h4
  • inhibits printing the 'now' date
l1
  • inhibit auto-suppress of mod-size if headings > 76 characters
l2
  • inhibit auto-suppress of mod-date if headings > 76 characters
l4
  • inhibit auto-suppress of now-date if headings > 76 characters
i1
  • inhibit sending laser printer initialization strings
  • use this for dot matrix or line printers
j=newpage,
  • change page eject pattern from default '*eject'
  • precede with '=' & follow with ',' (if any following options)
  • will search for eject1 pattern only within 1st 20 columns
k=altpage,
  • specify a 2nd pattern to cause formfeed
  • may vary in length up to 15 chars & anywhere within 80 columns
  • defaults to the '*eject' in CAPS (shown in lower to inhibit)
  • specify embedded blanks as underscores (for COBOL '______/')
m10
  • line# to begin test for '*eject' patterns on each page (dflt 10)
n
  • sequence# in 1st 4 columns with blank separator in column 5
  • does NOT conflict with option 'n1' inhibit wait for prompt
n2
  • zero suppress sequence#, vs n1 zero fill
  • default is no sequence numbering
n1
  • inhibit wait for reply to all prompts in program (Dec03/2014)
  • DOES conflict with above 'n' to sequence#
  • yet to be fixed as of Dec03/2014
o1
  • inhibit newpage on 1st *eject
o2
  • inhibit newpage on ALL *eject's

Goto:   Begin this document End this document UVSI Home-Page

C3. uvlist options (continued)

p60
  • lines per page before new page headings (default is 60 lines)
p0
  • inhibit FormFeed inserts (also specify h0 to inhibit pg hdngs)
q999
  • stop count, quit after processing specified no of records
r
  • End Of Record delimiter control
r0
  • default EOR is LineFeed & FormFeed
    (FormFeed terminates a record when LF missing)
r1
  • convert carriage returns (CR=0x0D) to 1 blank
r2
  • allow CRs to pass thru (usually not required on UNIX)
r4
  • ALSO end the record on a CR without a following LF (MacIntosh)
  • might be useful for COBOL programs converted from a mainframe
  • write BEFORE/AFTER spacing could result in missing LF's
s2-s8
  • spacing option 2 to 8 max (default s1 = single spacing)
t1-t9
  • convert each TAB (x'09') to the specified no of blanks
u1-u9
  • expand tabs to blanks depending on column position
  • normal UNIX tab behavior (ex: u4 = tab every 4 columns)
  • as a filter, specify h0p0i1 to inhibit pg hdngs & laser codes
v###
  • split longer lines to multi lines of v# chars (default v200)
w1
  • reduce multiple consecutive blanks within line to 1 blank
w2+
  • reduce 'mcb's to the option w fraction (1/2, 1/3, etc)
x1
  • inhibit default convert '%%' to '%.' (%% postscript cmd ID)
y###
  • print column scale (after pg hdng) of y# width (max y250)
z1
  • inhibit FormFeed in 1st record of file
z2
  • generate FormFeed at end of job
z4
  • generate 2nd FormFeed at end of job (z6 for 2 formfeeds)
z8
  • inhibit Formfeed if last (or 2nd last ) character in the file

Goto:   Begin this document End this document UVSI Home-Page

C4. uvlist options (continued)

Laser Printer PCL5 Options (group 2)


     uvlist file [Run-options] [Laser-options]   - command format
     ===========================*************=
a2
  • letter size paper
a3
  • legal size paper
a26
  • A4 European paper size
  • paper size might work better than tray# fro some laser printers
  • assign paper sizes to tray#s via tray settings or front panel menus
b0
  • BOLD off (default)
b3
  • BOLD on
c##
  • characters per inch (for HP laserjet 4 compatibles)
c10
  • 10 chars/inch (the default)
d0
  • duplex printing off (default)
d1
  • duplex printing for long edge binding (normal duplex)
d2
  • duplex printing for short edge binding (probably don't want)
 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####
  • font# (for HP laserjet 4 & compatibles)
f4099
  • courier font (scalable via option c for cpi)
i0
  • italic off (default)
i1
  • italic on
j-100
  • short edge margin offset in 1/720 inch increments (decipoints)
  • default -100, sets top (if portrait) margin up 100/720 inch
    j360 sets top margin down 1/2" (+ values set down, - values set up)
  • Reversed if LANDSCAPE (+ shifts up, - shifts down)
  • Reversed if LANDSCAPE/DUPLEX (+ shifts right, - shifts left)
k-100
  • short edge margin offset for backside when DUPLEX printing
  • default 'k-100' sets top margin up 100/720
  • Duplex/Portrait as expected (- shifts up, + shifts down)
  • Duplex/Landscape Reversed (+ shifts left, - shifts right)
Note
  • see 'long edge' margin options 'm' & 'n' on next page below
l#
  • line termination
l0
  • lines termianted by LF x'0A' (default for unix/linux)
l2
  • convert LF to CR + LF (x'0A' + x'0D')

Goto:   Begin this document End this document UVSI Home-Page

C5. uvlist options (continued)

Laser Printer PCL5 Options (group 2 continued)


     uvlist file [Run-options] [Laser-options]   - command format
     ===========================*************=
m300
  • long edge margin offset in 1/720 inch increments (decipoints)
  • default m300 offsets 300/720 inches right (for 3 hole punches)
  • m0 would set the printers hardware default (1/4" usually)
  • option 'm' always as expected, Portrait m+ shifts right, m- shifts left
    and Landscape m+ shifts down, m- shifts up
n000
  • long edge margin offset for backside when DUPLEX printing
  • option 'n' always Reversed from what you might expect
  • Duplex/Portrait: n+ shifts left, n- shifts right
  • Duplex/Landscape: n+ shifts up, n- shifts down
o0
  • page orientation (default 0 = portrait)
o1
  • landscape
  • note that margin codes are tricky for Landscape
    (think short edge & long edge margins, NOT top & left margins)
p62
  • lines per page for laser printer internal max (default 62)
  • also see option 'p' in the 'run format' option group, which controls
    the number of lines before new page headings are printed.
s0
  • spacing fixed (default)
s1
  • spacing proportional (for non-courier fonts)
t0
  • paper tray input (default t0 unspecified)
t1
  • tray #1
t2
  • tray #2
v8
  • vertical motion (line spacing) in 1/48 inch increments
  • default is 8/48 = 6 lines per inch
x1
  • number of copies (of each page)
  • useful for multiple copies of 1 page documents
NOTE
  • for decimal places, you must use the '=' method of option specs
    ('v=5.8' for vertical spacing 5.8/48")
  • see the example on next page --------->

Goto:   Begin this document End this document UVSI Home-Page

C6. uvlist options (continued)

uvlist laser options & PCL5 codes

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.

uvlist laser options & PCL5 code table

 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

C7. uvlist options (continued)

Notes re Tray & Paper size options

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)

Notes

  1. If you have problems specifying tray#s, you might specify options for paper size. Most laser printers allow you to assign paper size to the various tray#s via front panel menus.

  2. uvlist defaults the tray option to 't4', but this is disabled if you specify any paper size option 'a_'

  3. You may disable any of the uvlist laser options (shown on prior page) by specifying value '-' without any numeric value. (ex 't-' 'a-' etc). Then any front panel settings should apply & not be overridden by the PCL5 string generated by uvlist.

    sample uvlist commands

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

C8. uvlist.doc - Documentation Listing Utility

Environmental Variables for uvlist

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

C9. uvlist options (continued)

Example using options detailed on previous pages


     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
  • group1 options (Run options)
p60
  • specifies 60 lines per page (before uvlist generate formfeed)
  • inhibits uvlist generated page headings (COBOL report already has)
  • any options specified by user as arg#2 (following filename)
    (might specify 'b100e150' to print pages 100-150)
 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

note re options requiring decimal points

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

C10. uvlist options (continued)

options RULES & Examples

  1. Options may be entered on the program command line following the command name & the filename

  2. Options must be contiguous (no spaces between the option codes)

  3. There are 2 sets of options possible for the uvlist utility (Run options & HP Laser printer options)

  4. The program design allows for 26 option codes (ie the 26 letters of the alphabet)

  5. An option letter may be followed by a value pertaining to that option. If the value is numeric then no separators are required. If the value contains any non-numerics, then the value should be preceded by an '=' & followed by a ',' (if another option follows).

 ---------------------------- 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
  • m330 | lp - no Run options ('-' signals)
    m330 Laser option would offset
    left margin about 1/2" inch right
    (330 decipoints = 330/720")
 uvlist file p60h o1m100j-120c14v6 | lp
 uvlist file p60,h o1,m100,j-120,c14.5,v=5.9 | lp
Note
  • may use ','s between option alpha/numeric sets
  • MUST use '=' between option alpha letter & numeric value
    if the value contains a '.' decimal point
 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

D1. Shell Scripts provided for uvlist

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
  • See next page for a list of scripts provided
    with a variety of useful option combinations --------------------->

Goto:   Begin this document End this document UVSI Home-Page

D2. Shell Scripts provided for uvlist

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
     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

D3. Shell Scripts provided for uvlist

uvlp scripts for printing mainframe COBOL reports

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

D4. Shell Scripts provided for uvlist

section 'F' - printing all files in a directory

     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)

section 'G' - printing to AUX devices

G1. uvlpx - print on AUX device of Unix terminal
G2. uvlpx18 - print on AUX device of Unix terminal at 18 cpi

section 'H' - using uvlist on LINE printers

H2. uvlpi1 - using uvlist on non-laser printers (LINE/CHARACTER printers)

Goto:   Begin this document End this document UVSI Home-Page

E1. scripts provided for uvlist (in uvadm/sf/util)

uvlp12 - 12 cpi, 90 cpl, 60 lpp

 #!/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

E2. scripts provided for uvlist (in uvadm/sf/util)

uvlp12D - 12 cpi Duplex (VU documentation)

 #!/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

E3. scripts provided for uvlist

uvlp13L - 132 col, 66 lpp, Landscape, Simplex

 #!/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

E4. scripts provided for uvlist

uvlp13LD - 132 col, 66 lpp, Landscape, Duplex

 #!/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

E5. scripts provided for uvlist (in uvadm/sf/util)

uvlp18 - Portrait, Simplex, 132 col, 66 lpp

 #!/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

F1. uvlist scripts to print ALL files in a DIRECTORY

uvlpd12 - print ALL files in Directory Simplex

 #!/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

F2. uvlist scripts to print ALL files in a DIRECTORY

uvlpd12A - print ALL files in Directory S/D Automatic

 #!/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

G1. uvlist: scripts for printing on AUX devices of Unix terminals

 #!/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

G2. uvlist: scripts for printing on AUX devices of Unix terminals

 #!/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

H1. scripts to use uvlist with line/character printers

shell scripts for non-laser printers

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

  1. Begin & end printing at specified page numbers

  2. Print last 3 pages of a report (without knowing how many pages.

  3. Convert non-printable characters to spaces (so they don't drive the printer insane)

  4. Drop blank lines or reduce multiple blank lines to 1

  5. Convert Formfeeds to specified number of Linefeeds

  6. Sequence# lines in 1st 5 positions

  7. Space 2,3,4, up to 9

  8. specify desired no of lines per page (default 60)

  9. Specify page eject patterns other than Formfeed or every 60 lines

    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

H2. scripts to use uvlist with line/character printers

sample script using uvlist for a line printer

 #!/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

I1. Using uvlist as a FILTER to process files

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

uvlist filter ex#1 - Tab-stops to blanks

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>

test/demo file - OUTPUT

 # 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
  • option 'u4' converts tabs to blanks depending on column position
    assuming tab stops every 4 columns
  • UNIX programmers often 'set tab=4' in the .exrc file in $HOME
Note2
  • option 'i1' inhibits generating laser printer initialization
    strings at the begining of the output file
Note3
  • option 'h0' inhibits generating page headings every 60 lines.
  • since we want uvlist to operate as a filter & not insert any
    unwanted data into the output file
Note4
  • option 'p0' inhibits generating FormFeeds every 60 lines.

Goto:   Begin this document End this document UVSI Home-Page

I2. Using uvlist as a FILTER to process files

uvlist filter ex#2 - control codes to spaces

This example will convert control codes to spaces & remove blank lines.


 uvlist /home/uvadm/tf/tabtest c1d2i1h0p0 >tmp/ctltest
 =====================================================

INPUT test file

 # 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
 =======================================================================

OUTPUT test file

 # 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
  • option 'c1' has converted control codes to spaces.
  • 'tab' characters are therefore converted to spaces, causing the
    2nd line of 'a.bb.ccc.' in the OUTPUT file
Note2
  • option 'd2' drops all blank lines as you an see in the OUTPUT file
  • option 'd1' would reduce multiple consecutive blank lines to 1

Goto:   Begin this document End this document UVSI Home-Page

I3. Using uvlist as a FILTER to process files

uvlist filter ex#3 - compress blank lines & spaces

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
     ======================================

sample output of utmpdump

 [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
      =====================

sample output of uvlist

 [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
  • utmpdump does not create blank lines, I inserted to demo option 'd1'
  • see more on utmpdump at ADMjobs.htm#8J4.

Goto:   Begin this document End this document UVSI Home-Page

J1. Alternative method of printing reports on laser printers using uvcopy

This method uses uvcopy (vs uvlist) to concatenate a separate laser printer control file to the data file to be printed.

This is more work, but allows you to code your own HP PCL5 file of laser printer escape codes for complete flexibility.

Some escape control files are provided & you may copy, rename,& modify these to make whatever combination you require.

The 'escape1' uvcopy job & the following printer control files can be used to print reports on 8 1/2 x 11 paper. For example the following command would print 132 columns within 8 1/2 wide paper.


       uvcopy escape1,fili1=tf/HP18cpi,fili2=tf/test132
       ================================================

You would specify your report file in place of 'tf/test132', but you might find tf/test132 useful to test out your laser printer for compatibility.

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.

         10        20        30        40        50        60        70        80        90       100       110       120
 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567

The following printer control files are provided in the uvadm/tf directory.

    normal    - print at 10 cpi (76 chars on 8 1/2 wide)
    HP12cpi   - print at 12 cpi (90 chars on 8 1/2 wide)
    HP14cpi   - print at 14 cpi (108 chars on 8 1/2 wide)
    HP16cpi   - print at 16 cpi (120 chars on 8 1/2 wide)
    HP18cpi   - print at 18 cpi (134 chars on 8 1/2 wide)
    HPL12cpi  - print in Landscape mode at 12 cpi (120 chars on 8 1/2 wide)
    HPL14cpi  - print in Landscape mode at 12 cpi (144 chars on 8 1/2 wide)

These control files offset the left margin 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

K1. 'ibmlist1' - print a file with IBM carriage control characters

script to print file with IBM carriage control byte

 # 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

Visitor Counters for ThisYear and LastYear