[comp.sys.ibm.pc] "pr" for dos

mojo@micropro.UUCP (02/24/87)

This may seem silly.

Most of the time I find people with pretty printing utilities up the
wazoo.  But I always found myself returning to UNIX to get either
a multiple column listing, or several files listed simultaneously.
Seems like none of the pr utilities on DOS had those options.  So I
wrote one.

My object was to make it look as much like vanilla UNIX pr as possible.
Following is the (UNIX-style) manual page for my pr.  My object is
to see if there is enough interest for me to post the executable
and source.  None of it is tremendously large, but I'd rather find out
first.

"Weather is here.  Wish you were beautiful.  Please write."

==================================================================
MicroPro Standard Library                                       pr


NAME
     pr - print file

SYNOPSIS
     pr [ option ] ... [ file ] ...

DESCRIPTION
     Pr produces a printed listing of one or  more  files.    The
     output is separated into pages headed by a date, the name of
     the  file  or a specified header,  and the page number.   If
     there are no file arguments, pr prints its standard input.

     Options apply to all following files but may  be  reset  be-
     tween files:

     /n   Produce n-column output.

     /pn  Begin printing with page n.

     /h   Take the next argument as a page header.

     /wn  Take  the  width of the page to be n characters instead
          of the default 80.  (UNIX default is 72.)

     /f   Use formfeeds instead of newlines to separate pages.  A
          formfeed is assumed to use up two blank  lines  at  the
          top  of a page.   (Thus this option does not affect the
          effective page length.)

     /ln  Take the length of the page to be n  lines  instead  of
          the default 66.

     /t   Do  not  print  the 5-line header or the 5-line trailer
          normally supplied for each page.

     /sc  Separate columns by the single character c  instead  of
          by the appropriate amount of white space.   A missing c
          is taken to be a tab.

     /m   Print all files simultaneously, each in one column.

     /Tn  Take the width of a tab character to be  n  instead  of
          the default 8.

     Note the following differences between UNIX pr(1) and PC-DOS
     pr:

     .    The  switch character may be changed from `/' to `-' by
          the documented methods.

     .    The option structure  follows  the  conventions  estab-
          lished  by  AT&T for UNIX command options,  enforced by
          the use of the getopt() function.  Options that require

December 5, 1986                                            Page 1



MicroPro Standard Library                                       pr

          arguments (such as /l) may have white space between the
          option and the argument or not.  Several options may be
          concatenated behind a single `/' with  no  white  space
          separating them.

     .    More  than  9  columns  are not supported,  or 15 files
          printed simultaneously.

     .    The UNIX "+n" option is replaced by "/pn".

EXAMPLE

          pr /t /m filea fileb filec

     will print out the three files simultaneously,  each in  one
column, without headers.

AUTHOR

     Mojo Jones, mojo@micropro.UUCP

December 5, 1986                                            Page 2

anderson@uwmacc.UUCP (02/25/87)

In article <286@micropro.UUCP|, mojo@micropro.UUCP (Morris Jones) writes:
| This may seem silly.

On the contrary!

|[...] 
| Seems like none of the pr utilities on DOS had those options.  So I
| wrote one.
 
| My object was to make it look as much like vanilla UNIX pr as possible.
| Following is the (UNIX-style) manual page for my pr.  My object is
| to see if there is enough interest for me to post the executable
| and source.  None of it is tremendously large, but I'd rather find out
| first.

Man pages looked good to me. How about posting it to SIMTEL20's MSDOS
archive? That way everyone who wanted it later could get it. As for me,
if you're willing, by all means e-mail the goodies. I was just about to
write something that would put the name of the file being listed on
the output, and I think you've saved me that labor.
 
| "Weather is here.  Wish you were beautiful.  Please write."
 
How odd! I saw this card in a store for the first time just a
couple hours ago!

[man pages deleted]

-- 
==ARPA:==============anderson@unix.macc.wisc.edu===Jess Anderson======
| UUCP: {harvard,seismo,rutgers,  (avoid ihnp4!)   1210 W. Dayton    | 
|    akgua,allegra,usbvax}!uwvax!uwmacc!anderson   Madison, WI 53706 |
==BITNET:======================anderson@wiscmacc===608/263-6988=======

keithe@tekgvs.UUCP (02/26/87)

In article <1108@uwmacc.UUCP> anderson@uwmacc.UUCP (Jess Anderson) writes:
>
>Man pages looked good to me. How about posting it to SIMTEL20's MSDOS
>archive? That way everyone who wanted it later could get it.

Uh, don't count on it. You have no idea how _frustrating_ it is to
be stuck on the uucp side of things (?) with no access to the SIMTEL
archives. (Or at least none that our UNIX and/or Telecomm people have
come up with.)

keith (post 'pr', please) ericson

anderson@uwmacc.UUCP (02/27/87)

In article <2120@tekgvs.TEK.COM>, keithe@tekgvs.TEK.COM (Keith Ericson) writes:
> In article <1108@uwmacc.UUCP> anderson@uwmacc.UUCP (Jess Anderson) writes:

> >How about posting it to SIMTEL20's MSDOS
> >archive? That way everyone who wanted it later could get it.
 
> Uh, don't count on it. You have no idea how _frustrating_ it is to
> be stuck on the uucp side of things (?) with no access to the SIMTEL
> archives. (Or at least none that our UNIX and/or Telecomm people have
> come up with.)
 
Sorry, I guess I didn't realize that you had to have arpa access to get
SIMTEL20's stuff. Well, most of us wallow in ignorance of one or more
kinds. Sorry to have hit a nerve there. Now that I've reaped so many
wonderful (fun, anyway) benefits from access to SIMTEL20, I'd be grieved
as hell to be deprived of it. 

You gurus out there: is there no relief for a uucp-only site in this
matter? One of SIMTEL20's virtues, in my book, is the *vast* archive
of PD software (much, if not most, of it with binaries) they maintain.
Arpanet traffic is such that the most favorable time to move a large
file is in the dead of night.

There are various other net-accessible archives (some, like info-ibmpc,
carrying only sources). Although it seems to cause an outcry nearly
every time it happens, I watch this group like a hawk for the many
useful binaries that get posted here. Many people hate that, but I
like it. I note that an st binaries group has just been set up. I
assume the main factor is the existence of a person with a lot of
time and disk willing to do the (substantial) labor. 

> keith (post 'pr', please) ericson

pr got posted yesterday. Works like a champ, and was exactly what
I needed.
-- 
==ARPA:==============anderson@unix.macc.wisc.edu===Jess Anderson======
| UUCP: {harvard,seismo,rutgers,  (avoid ihnp4!)   1210 W. Dayton    | 
|    akgua,allegra,usbvax}!uwvax!uwmacc!anderson   Madison, WI 53706 |
==BITNET:======================anderson@wiscmacc===608/263-6988=======

pitaro@savax.UUCP (02/27/87)

In article <1129@uwmacc.UUCP>, anderson@uwmacc.UUCP (Jess Anderson) writes:
> In article <2120@tekgvs.TEK.COM>, keithe@tekgvs.TEK.COM (Keith Ericson) writes:
> > In article <1108@uwmacc.UUCP> anderson@uwmacc.UUCP (Jess Anderson) writes:
> 
> > >How about posting it to SIMTEL20's MSDOS
> > >archive? That way everyone who wanted it later could get it.
>  
> > Uh, don't count on it. You have no idea how _frustrating_ it is to
> > be stuck on the uucp side of things (?) with no access to the SIMTEL
> > archives. (Or at least none that our UNIX and/or Telecomm people have
> > come up with.)
>  
> Sorry, I guess I didn't realize that you had to have arpa access to get
> SIMTEL20's stuff. Well, most of us wallow in ignorance of one or more
>	.
>	.
>	. 
> You gurus out there: is there no relief for a uucp-only site in this
> matter? One of SIMTEL20's virtues, in my book, is the *vast* archive

Well I'm no guru but a uucp site can access SIMTEL20.  It works by sending
a message asking for files through an ARPA gateway.  There are a number of
them but the one I've always used is ucbvax.  Basically you send a specially
formatted message to the archive server.  For instance, send a message to
	decvax!ucbvax!simtel20.ARPA!ARCHIVE-REQUEST
which says
	SEND INFO
This will send you a message over the reverse path telling you how to get
various pieces of software from them.  Once you get that message use one of
the recommended gateways close to your site to keep everyones phone bill down.
Your messages asking for files will look like
	SEND ARE PD:<MSDOS.MICRO-EMACS>EMACSSRC38B.ARC
	SEND ARE PD:<MSDOS.MICRO-EMACS>EMACSEXE38B.ARC
	SEND ARE PD:<MSDOS.MICRO-EMACS>EMACDOCC38B.ARC
with up to five requests per message. Once you get the files they will be in
uuencoded ARC format.  To recover them I would suggest using an ascii protocol
to transfer them to your PC.  Editing them to create the uudecode file.
UUdecode them, and then run ARC.  I find this method easier than running
UUdecode on a UNIX system and then worrying about a binary transfer protocol
to your PC.

	Michael Pitaro

USMail:	Sanders Associates		UUCP:	decvax!savax!pitaro
	MER24-1583C			PHONE:	+1 (603) 885-9036
	CS 2034				HOME:	46-D Hampshire Drive
	Nashua, NH 03063-2034			Nashua, NH 03063

dsd@hpsadla.UUCP (02/27/87)

Looks good, please post it.

Don St. Denis

keithe@tekgvs.UUCP (02/27/87)

In article <1129@uwmacc.UUCP> anderson@uwmacc.UUCP (Jess Anderson) writes:
>In article <2120@tekgvs.TEK.COM>, keithe@tekgvs.TEK.COM (Keith Ericson) writes:
>> In article <1108@uwmacc.UUCP> anderson@uwmacc.UUCP (Jess Anderson) writes:
>
>> >How about posting it to SIMTEL20's MSDOS
>> >archive? That way everyone who wanted it later could get it.
> 
>> Uh, don't count on it. You have no idea how _frustrating_ it is to
>> be stuck on the uucp side of things...
> 
>Sorry, I guess I didn't realize that you had to have arpa access to get
>SIMTEL20's stuff...
>
As a result of my posting I've received some pointers on accessing
the SIMTEL20 archives; I tried one and await the result. Should it
work I'll share it with everyone.

keith (are you really out there, SIMTEL20?) ericson

# this filler line to satisfy the news poster
# this filler line to satisfy the news poster
# this filler line to satisfy the news poster
# this filler line to satisfy the news poster
# this filler line to satisfy the news poster
# this filler line to satisfy the news poster

paradis@encore.UUCP (02/27/87)

>> Uh, don't count on it. You have no idea how _frustrating_ it is to
>> be stuck on the uucp side of things (?) with no access to the SIMTEL
>> archives. (Or at least none that our UNIX and/or Telecomm people have
>> come up with.)

Can you send mail to SIMTEL20?  If you can, then you can access the
archives.  SIMTEL20 has a mail server that does nothing but handle
archive requests.  To get started, send the following one-line message:

	SEND HELP

to any of the following addresses:

   ...!ucbvax!simtel20.arpa!archive-request
   ...!uw-beaver!simtel20.arpa!archive-request
   ...!decwrl!simtel20.arpa!archive-request
   ...!lll-crg!simtel20.arpa!archive-request
   ...!ut-sally!simtel20.arpa!archive-request
   ...!harvard!simtel20.arpa!archive-request

[do NOT use host "seismo" - they are blocking messages from the server]

Within a few days, you'll receive a document in your mailbox telling
how to use the archives.

Have fun!

   +----------------+  Jim Paradis                  linus--+
+--+-------------+  |  Encore Computer Corp.       necntc--|
|  | E N C O R E |  |  257 Cedar Hill St.           ihnp4--+-encore!paradis
|  +-------------+--+  Marlboro MA 01752            necis--|
+----------------+     (617) 460-0500             talcott--+
All opinions are my own... Encore doesn't know I'm saying any of this!

phil@sci.UUCP (03/02/87)

while we are talking about accessing various archives,
could some kind soul please tell me how to access info-pc?

also, i have access to SIMTEL20 via uucp mail thru a node that accepts
addresses with xxx.arpa
this works for mail only and SIMTEL can auto send with a SEND line in a
mail message. however, i have found it to be vary unreliable. only about
one request out of five gets answered. any ideas?

w8sdz@brl-smoke.ARPA (Keith B. Petersen ) (03/07/87)

To obtain up to five files in a single request message by netmail from
the public domain archives kept on SIMTEL20.ARPA, send a message to:

ARCHIVE-REQUEST@SIMTEL20.ARPA

or via uucp:
   ...!ucbvax!simtel20.arpa!archive-request
   ...!uw-beaver!simtel20.arpa!archive-request
   ...!decwrl!simtel20.arpa!archive-request
   ...!lll-crg!simtel20.arpa!archive-request
   ...!ut-sally!simtel20.arpa!archive-request
   ...!harvard!simtel20.arpa!archive-request

[do NOT use host "seismo" - they are blocking messages from the server]

The message body must contain lines beginning with the keyword SEND,
one SEND line for each file requested.  Case is not significant.

The general syntax of a SEND line is:

SEND format filename

In general, a filename consists of the following components:

device:<directory>file.type.generation

"device:" is usually PD:, and the combination of PD:<directory> is
expected unless an alias has been advertised of the form "alias:",
which takes the place of both device and directory fields.  The
generation field should be left off in order to default to the highest
generation number so you can be sure of getting the latest version of
the file requested.  "file.type" follows the usual filenaming
conventions.

In all formats listed below, if the file to be sent is larger than
55K, the file is sent in numbered parts.  The parts must be
reassembled in order and edited to remove any headers, preface, and
trailers before the process can be reversed to reconstruct the
original file.

Allowable formats are:

SEND HELP
        This file you are reading now.

SEND INFO
        A detailed description of the SIMTEL20 Archives, which
        includes this file, pointers to certain key files, and
        descriptions of various file transfer programs and related
        utilities.

SEND BOOTSTRAP
        A brief quick reference listing of filenames of the key
        utilities used to reconstruct files sent by the compression
        and encoding techniques listed below.

SEND DIR filespec
        This format returns a CRC list of the requested files, and is
        the only format which allows wildcard filenames (but not
        wildcard directory names).  The list is sent as an ASCII text
        file.  The wildcard characters are "*" and "%".  The asterisk
        means any number of characters, while the percent sign means
        exactly one character.  Either or both may appear in any
        combination in either or both the file or type fields, while
        only the asterisk may appear in the generation field.

SEND RAW filename
        If the file is ASCII, it is sent as-is, regardless of size.
        This format is the least efficient over network and mail
        gateway resources.  Use this format only if you absolutely
        must.

With the four formats listed below, if the file is ASCII and under 25k
characters, it is sent as-is, as if RAW format was requested.  Binary
files are always processed according to the requested format.
However, a request for ARC or SQ processing of files with type ".ARC",
".LBR", or ".%Q%" is ignored and the original file is either uuencoded
or hexified (if possible), according to the requested format.  If the
file was not sent RAW, a short preface is inserted at the front of the
message describing the process actually taken and a CRC entry
describing the original file.

SEND ARE filename  or  SEND filename
        The original file is made into a uuencoded ARC file.

SEND ARH filename
        The original file is made into a hexified ARC file if the ARC
        file is under 64K bytes long.  Otherwise, an apology is
        returned instead of the requested file.

SEND SQE filename
        The original file is made into a uuencoded SQueezed file.

SEND SQH filename
        The original file is made into a hexified SQueezed file if the
        Squeezed file is under 64K bytes long.  Otherwise, an apology
        is returned instead of the requested file.

To get started in finding your way around the SIMTEL20 archives, send
a message to the server with the request: SEND INFO

-- 
--Keith Petersen
Arpa: W8SDZ@SIMTEL20.ARPA
Uucp: {bellcore,decwrl,harvard,lll-crg,ucbvax,uw-beaver}!simtel20.arpa!w8sdz
GEnie Mail: W8SDZ