home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / NEWSHAR.ZIP / SHAR.DOC < prev    next >
Text File  |  1992-02-05  |  5KB  |  132 lines

  1. A VERY quick guide to using shar under OS/2
  2. --====-------------------------------------
  3.  
  4. 1.  To construct a shell archive:
  5.  
  6.        shar -a file1 file2 .... fileN >sharfile
  7.  
  8. where file1 ... fileN are the names of the input files and sharfile is
  9. the name of the output file.  Wildcards are allowed in the input names.
  10.  
  11. (Note: For export to UNIX you'll want to feed the output to "flip" to
  12.  remove the carriage returns!)
  13.  
  14. 2.  To decompose a shell archive:
  15.  
  16.        shar -u sharfile
  17.  
  18. There is no need to trim header and trailer junk from Usenet postings
  19. and multiple postings may be processed in the one 'sharfile' so long as
  20. they were saved in the right order.
  21.  
  22.  
  23. History
  24. -------
  25.  
  26. The UNIX program 'shar' (from "shell archive") puts readable text files
  27. together in a package from which they are easy to extract by feeding the
  28. package to the shell, typically 'sh'.  On UNIX systems, source code is
  29. frequently distributed as shell archives because it can pass through
  30. various mail systems without corruption.  In 1986 a version of shar was
  31. ported to CP/M and in addition to being able to construct shell archives
  32. the program could also decompose them.  Since CP/M did not have a Bourne
  33. shell shar was a useful tool for dealing with shell archives created on
  34. UNIX systems.
  35.  
  36. In late 1989 I made minimal changes to the program to compile it for OS/2
  37. 1.1 and MSDOS 3.3.  In common with its CP/M predecessor, when extracting
  38. files from a shell archive, that version of shar would trim file names to
  39. comply with the "8.3" length restrictions and would put all extracted
  40. files into the current directory.
  41.  
  42. Recently I was motivated to remove all the limitations and restrictions.
  43. Shar's habit of truncating file names was annoying and created its own set
  44. of problems.  Furthermore, it is unnecesary when using OS/2's High Per-
  45. formance File System (HPFS).  Shar's inability to construct directories
  46. made the handling of many shell archives retrieved from Usenet postings
  47. very troublesome indeed.
  48.  
  49. The enclosed version of shar is strictly for OS/2 HPFS although of course
  50. it will work for FAT file systems if the file names already comply with
  51. the 8.3 limitations.  (Indeed, under such circumstances the program could
  52. be compiled for and executed under MSDOS.)
  53.  
  54. With the -u (unshar) option this program creates directories as needed
  55. and deposits extracted members into the correct places.
  56.  
  57. As implied above, no longer is any attempt made to rectify file names
  58. for FAT or CP/M file systems.  Code for VMS has been deleted; code for
  59. ULTRIX and the Amiga has been retained without verification.
  60.  
  61. There is a problem in constructing shell archives with this program which
  62. I do not know how to cure.  If you say:
  63.  
  64.         shar * >xyz
  65.  
  66. or some variant thereof then OS/2 creates the output file 'xyz' before
  67. the C library argument parser gets control.  This means that file xyz
  68. is included among the files to be archived and the archive grows until
  69. disk space is exhausted.
  70.  
  71. Operationally, the solution is simple enough - redirect the shar output
  72. to a file in a directory other than the one containing the source files.
  73. However that is not such an easy thing to remember.  I guess the proper
  74. answer is to avoid using redirection and devise a new command syntax,
  75. perhaps something like:-
  76.  
  77.         shar archive-name options files
  78.  
  79. Then the archive would not be created until after wildcard expansion of
  80. the command line has occurred and so would not confuse the program.  If
  81. anyone has a better idea I would love to hear it.
  82.  
  83. Because I envisage that this program is more likely to be used for
  84. decomposing shell archives rather than constructing them I have not
  85. bothered to fix the problem.
  86.  
  87. Jon Saxton
  88. February 1992
  89.  
  90. ========================================================================
  91.  
  92. Notes for previous versions follow:-
  93.  
  94. ------------------------------------------------------------------------
  95.  
  96. This is a second-round port of the UNIXy "shar" (shell archive)
  97. program.  It can create or decompose a shell archive file.
  98.  
  99. Note that shell archives are NOT compressed in any way.  Their
  100. principal use is to combine multiple text files so as to simplify
  101. distribution of program sources and data.
  102.  
  103. Compiled with Microsoft C 5.1 for MS-DOS and OS/2.
  104.  
  105. The comments included with the CP/M version follow.
  106.  
  107. ------------------------------------------------------------------
  108.  
  109.                              READ_ME
  110.  
  111. This program is both a "shar" and a "unshar" program for those
  112. of us with no shell.
  113.  
  114. I have ported the recently posted shar.c to (z80) CP/M.  This
  115. distribution has been shar'd with this program.
  116.  
  117. When run under CP/M 3.0 with time-of-day supported,
  118. shar files created will have archive creation time included.
  119.  
  120. The uuencoded binary included (shar.com) looks for a file
  121. "ENVIRON.DAT" or "A:ENVIRON.DAT" for the environment variables.
  122. Variables used are "NAME=" and "ORGANIZATION=".
  123.  
  124. Uuencoding of the binary was done with the recently posted
  125. turbo-pascal uuencode.com program.
  126.  
  127. The attached binary was compiled using Manx Aztec C II v1.05g (z80).
  128.  
  129. Mike Kersenbrock (usenet:{decvax,ucbvax...}!tektronix!copper!michaelk)
  130. Aloha, Oregon
  131. 7/17/86
  132.