home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
packer
/
shar
/
shar.doc
< prev
next >
Wrap
Text File
|
1994-02-03
|
5KB
|
132 lines
A VERY quick guide to using shar under OS/2
--====-------------------------------------
1. To construct a shell archive:
shar -a file1 file2 .... fileN >sharfile
where file1 ... fileN are the names of the input files and sharfile is
the name of the output file. Wildcards are allowed in the input names.
(Note: For export to UNIX you'll want to feed the output to "flip" to
remove the carriage returns!)
2. To decompose a shell archive:
shar -u sharfile
There is no need to trim header and trailer junk from Usenet postings
and multiple postings may be processed in the one 'sharfile' so long as
they were saved in the right order.
History
-------
The UNIX program 'shar' (from "shell archive") puts readable text files
together in a package from which they are easy to extract by feeding the
package to the shell, typically 'sh'. On UNIX systems, source code is
frequently distributed as shell archives because it can pass through
various mail systems without corruption. In 1986 a version of shar was
ported to CP/M and in addition to being able to construct shell archives
the program could also decompose them. Since CP/M did not have a Bourne
shell shar was a useful tool for dealing with shell archives created on
UNIX systems.
In late 1989 I made minimal changes to the program to compile it for OS/2
1.1 and MSDOS 3.3. In common with its CP/M predecessor, when extracting
files from a shell archive, that version of shar would trim file names to
comply with the "8.3" length restrictions and would put all extracted
files into the current directory.
Recently I was motivated to remove all the limitations and restrictions.
Shar's habit of truncating file names was annoying and created its own set
of problems. Furthermore, it is unnecesary when using OS/2's High Per-
formance File System (HPFS). Shar's inability to construct directories
made the handling of many shell archives retrieved from Usenet postings
very troublesome indeed.
The enclosed version of shar is strictly for OS/2 HPFS although of course
it will work for FAT file systems if the file names already comply with
the 8.3 limitations. (Indeed, under such circumstances the program could
be compiled for and executed under MSDOS.)
With the -u (unshar) option this program creates directories as needed
and deposits extracted members into the correct places.
As implied above, no longer is any attempt made to rectify file names
for FAT or CP/M file systems. Code for VMS has been deleted; code for
ULTRIX and the Amiga has been retained without verification.
There is a problem in constructing shell archives with this program which
I do not know how to cure. If you say:
shar * >xyz
or some variant thereof then OS/2 creates the output file 'xyz' before
the C library argument parser gets control. This means that file xyz
is included among the files to be archived and the archive grows until
disk space is exhausted.
Operationally, the solution is simple enough - redirect the shar output
to a file in a directory other than the one containing the source files.
However that is not such an easy thing to remember. I guess the proper
answer is to avoid using redirection and devise a new command syntax,
perhaps something like:-
shar archive-name options files
Then the archive would not be created until after wildcard expansion of
the command line has occurred and so would not confuse the program. If
anyone has a better idea I would love to hear it.
Because I envisage that this program is more likely to be used for
decomposing shell archives rather than constructing them I have not
bothered to fix the problem.
Jon Saxton
February 1992
========================================================================
Notes for previous versions follow:-
------------------------------------------------------------------------
This is a second-round port of the UNIXy "shar" (shell archive)
program. It can create or decompose a shell archive file.
Note that shell archives are NOT compressed in any way. Their
principal use is to combine multiple text files so as to simplify
distribution of program sources and data.
Compiled with Microsoft C 5.1 for MS-DOS and OS/2.
The comments included with the CP/M version follow.
------------------------------------------------------------------
READ_ME
This program is both a "shar" and a "unshar" program for those
of us with no shell.
I have ported the recently posted shar.c to (z80) CP/M. This
distribution has been shar'd with this program.
When run under CP/M 3.0 with time-of-day supported,
shar files created will have archive creation time included.
The uuencoded binary included (shar.com) looks for a file
"ENVIRON.DAT" or "A:ENVIRON.DAT" for the environment variables.
Variables used are "NAME=" and "ORGANIZATION=".
Uuencoding of the binary was done with the recently posted
turbo-pascal uuencode.com program.
The attached binary was compiled using Manx Aztec C II v1.05g (z80).
Mike Kersenbrock (usenet:{decvax,ucbvax...}!tektronix!copper!michaelk)
Aloha, Oregon
7/17/86