home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / sharutils-4.1-bin.lha / info / sharutils.info (.txt)
GNU Info File  |  1996-10-12  |  20KB  |  398 lines

  1. This is Info file sharutils.info, produced by Makeinfo-1.63 from the
  2. input file sharutils.texi.
  3. START-INFO-DIR-ENTRY
  4. * Shar utilities: (sharutils).
  5.                                 GNU set of shar utilities.
  6. * shar invocation: (sharutils) shar invocation.
  7.                                 Produce a shell archive out of many files.
  8. * unshar invocation: (sharutils) unshar invocation.
  9.                                 Recontruct files out of a shell archive.
  10. END-INFO-DIR-ENTRY
  11.    This file documents the GNU set of shar utilities.
  12.    Copyright (C) 1994 Free Software Foundation, Inc.
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided that
  18. the entire resulting derived work is distributed under the terms of a
  19. permission notice identical to this one.
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that this permission notice may be stated in a
  23. translation approved by the Foundation.
  24. File: sharutils.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  25. GNU `shar' utilities
  26. ********************
  27.    GNU `shar' makes so-called shell archives out of many files,
  28. preparing them for transmission by electronic mail services.  GNU
  29. `unshar' helps unpacking shell archives after reception.  This is
  30. release 4.1.
  31. * Menu:
  32. * Introduction::                Introduction to both programs
  33. * shar invocation::             Invoking the `shar' program
  34. * unshar invocation::           Invoking the `unshar' program
  35. * Miscellaneous::               Miscellaneous considerations
  36.  -- The Detailed Node Listing --
  37. Creating shell archives
  38. * Selecting::                   Selecting files
  39. * Splitting::                   Splitting output
  40. * Headers::                     Controlling the shar headers
  41. * Stocking::                    Selecting how files are stocked
  42. * Transmission::                Protecting against transmission
  43. * Kinds::                       Producing different kinds of shar
  44. File: sharutils.info,  Node: Introduction,  Next: shar invocation,  Prev: Top,  Up: Top
  45. Introduction to both programs
  46. *****************************
  47.    GNU `shar' makes so-called shell archives out of many files,
  48. preparing them for transmission by electronic mail services.  A "shell
  49. archive" is a collection of files that can be unpacked by `/bin/sh'.  A
  50. wide range of features provide extensive flexibility in manufacturing
  51. shars and in specifying shar *smartness*.  *Note shar invocation::.
  52.    GNU `unshar' scans mail messages looking for the start of a shell
  53. archive.  This removes the mail headers and any lines of
  54. correspondence.  The body of the archive is then unpacked by a copy of
  55. the shell.  It can process multiple files at once.  It may also process
  56. files containing concatenated shell archives.  *Note unshar
  57. invocation::.
  58.    GNU `shar' has a long history.  All along this long road, numerous
  59. users contributed various improvements.  The file `THANKS', from the
  60. GNU `shar' distribution, contain all names still having valid email
  61. addresses, as far as we know.
  62.    Please help me getting the history straight, for the following
  63. information is approximative.  James Gosling wrote the public domain
  64. `shar 1.x'.  William Davidsen rewrote it as `shar 2.x'.  Warren Tucker
  65. brought modifications and called it `shar 3.x'.  Richard Gumpertz
  66. maintained it until 1990.  Franc,ois Pinard, from the public domain
  67. `shar 3.49', made `GNU shar 4.x', in 1994.  Some modules and other code
  68. sections were freely borrowed from other GNU distributions, bringing
  69. this `shar' under the terms of the GNU General Public License.
  70.    Your feedback helps us to make a better and more portable product.
  71. Mail suggestions and bug reports (including documentation errors) for
  72. these programs to `bug-gnu-utils@prep.ai.mit.edu'.
  73. File: sharutils.info,  Node: shar invocation,  Next: unshar invocation,  Prev: Introduction,  Up: Top
  74. Invoking the `shar' program
  75. ***************************
  76.    The format of the `shar' command is one of:
  77.      shar [ OPTION ] ... FILE ...
  78.      shar -S [ OPTION ] ...
  79.    In the first form, the file list is given as command arguments.  In
  80. the second form, the file list is read from standard input.  The
  81. resulting archive is sent to standard output unless the `-o' option is
  82. given.
  83.    Options can be given in any order.  Some options depend on each
  84. other: the `-o' option is required if the `-l' or `-L' option is used.
  85. The `-n' option is required if the `-a' option is used.  Also see `-V'
  86. below.
  87.    Some options are special purpose:
  88. `--help'
  89.      Print a help summary on standard output, then immediately exits.
  90. `--version'
  91.      Print the version number of the program on standard output, then
  92.      immediately exits.
  93. `--quiet'
  94.      Verbose *off* at `shar' time.  Messages are usually issued on
  95.      standard error to let the user follow the progress, while making
  96.      the archives.  This option inhibits these messages.
  97. * Menu:
  98. * Selecting::                   Selecting files
  99. * Splitting::                   Splitting output
  100. * Headers::                     Controlling the shar headers
  101. * Stocking::                    Selecting how files are stocked
  102. * Transmission::                Protecting against transmission
  103. * Kinds::                       Producing different kinds of shar
  104. File: sharutils.info,  Node: Selecting,  Next: Splitting,  Prev: shar invocation,  Up: shar invocation
  105. Selecting files
  106. ===============
  107. `--intermix-type'
  108.      Allow positional parameter options.  The options `-M', `-B', `-T',
  109.      `-z' and `-Z' may be embedded, and files to the right of the
  110.      option will be processed in the specified mode.  Without the `-p'
  111.      option, embedded options would be interpreted as filenames.  *Note
  112.      Stocking:: for more information on these options.
  113. `--stdin-file-list'
  114.      Read list of files to be packed from the standard input rather
  115.      than from the command line.  Input must be one filename per line.
  116.      This switch is especially useful when the command line will not
  117.      hold the list of files to be packed.  For example:
  118.           find . -type f -print | shar -S -o /tmp/big.shar
  119.      If `-p' is specified on the command line, then the options `-M',
  120.      `-B', `-T', `-z' and `-Z' may be included in the standard input
  121.      (on a line separate from filenames).  The maximum number of lines
  122.      of standard input, file names and options, may not exceed 1024.
  123. File: sharutils.info,  Node: Splitting,  Next: Headers,  Prev: Selecting,  Up: shar invocation
  124. Splitting output
  125. ================
  126. `-o PREFIX'
  127. `--output-prefix=PREFIX'
  128.      Save the archive to files `PREFIX.01' through `PREFIX.NNN' instead
  129.      of standard output.  This option *must* be used when the `-l' or
  130.      the `-L' switches are used.
  131. `-l SIZE'
  132. `--whole-size-limit=SIZE'
  133.      Limit the output file size to SIZE times 1024 bytes but don't
  134.      split input files.  This allows the recipient of the shell archives
  135.      to unpack them in any order.
  136. `-L SIZE'
  137. `--split-size-limit=SIZE'
  138.      Limit output file size to SIZE times 1024 bytes and split files if
  139.      necessary.  The archives created with this option must be unpacked
  140.      in the correct order.  If the recipient of the shell archives
  141.      wants to put all of them in a single folder, she shall save them
  142.      in the correct order for `unshar', used with option `-e', to
  143.      unpack them all at once.  *Note unshar invocation::.
  144.      For people used to saving all the shell archives into a single mail
  145.      folder, care must be taken to save them in the appropriate order.
  146.      For those having the appropriate tools (like Masanobu Umeda's
  147.      `rmailsort' package for GNU Emacs), shell archives can be saved in
  148.      any order, then sorted by increasing date (or send time) before
  149.      massive unpacking.
  150. File: sharutils.info,  Node: Headers,  Next: Stocking,  Prev: Splitting,  Up: shar invocation
  151. Controlling the shar headers
  152. ============================
  153. `-n NAME'
  154. `--archive-name=NAME'
  155.      Name of archive to be included in the header of the shar files.
  156.      Also see the `-a' switch further down.
  157. `-s ADDRESS'
  158. `--submitter=ADDRESS'
  159.      The `-s' option allows for overriding the email address for the
  160.      submitter, for when the default is not appropriate.  The
  161.      automatically determined address looks like `USERNAME@HOSTNAME'.
  162. `--net-headers'
  163.      Allows automatic generation of headers:
  164.           Submitted-by: ADDRESS
  165.           Archive-name: NAME/partNN
  166.      The NAME must be given with the `-n' switch.  If name includes a
  167.      `/', then `/part' isn't used. Thus `-n xyzzy' produces:
  168.           xyzzy/part01
  169.           xyzzy/part02
  170.      while `-n xyzzy/patch' produces:
  171.           xyzzy/patch01
  172.           xyzzy/patch02
  173.      and `-n xyzzy/patch01.' produces:
  174.           xyzzy/patch01.01
  175.           xyzzy/patch01.02
  176. `--cut-mark'
  177.      Start the shar with a cut line.  A line saying `Cut here' is
  178.      placed at the start of each output file.
  179. File: sharutils.info,  Node: Stocking,  Next: Transmission,  Prev: Headers,  Up: shar invocation
  180. Selecting how files are stocked
  181. ===============================
  182. `--text-files'
  183.      Treat all files as text, regardless of their contents.
  184. `--uuencode'
  185.      Treat all files as binary, use `uuencode' prior to packing. This
  186.      increases the size of the archive. The recipient must have
  187.      `uudecode' in order to unpack.
  188.           Use of `uuencode' is not appreciated by many on the net, because
  189.           people like to readily see, by mere inspection of a shell archive,
  190.           what it is about.
  191. `--mixed-uuencode'
  192.      Mixed mode.  Automatically determine if the files are text or
  193.      binary and archive correctly.  Files found to be binary are
  194.      uuencoded prior to packing.  This option is selected by default.
  195.      For a file is considered to be a text file, instead of a binary
  196.      file, all the following should be true simultaneously:
  197.        1. The file does not contain any ASCII control character besides
  198.           BS (backspace), HT (horizontal tab), LF (new line) or FF
  199.           (form feed).
  200.        2. The file does not contains a DEL (delete).
  201.        3. The file contains no character with its eighth-bit set.
  202.        4. The file, unless totally empty, terminates with a LF
  203.           (newline).
  204.        5. No line in the file contains more than 200 characters.  For
  205.           counting purpose, lines are separated by a LF (newline).
  206. `--gzip'
  207.      Use `gzip' and `uuencode' on all files prior to packing.  The
  208.      recipient must have `uudecode' and `gzip' (used with `-d') in
  209.      order to unpack.
  210.      Usage of `-z' in net shars will cause you to be flamed off the
  211.      earth.
  212. `-g LEVEL'
  213. `--level-for-gzip=LEVEL'
  214.      When doing compression, use `-LEVEL' as a parameter to `gzip'.
  215.      The `-g' option turns on the `-z' option by default.  The default
  216.      value is 9, that is, maximum compression.
  217. `--compress'
  218.      Use `compress' and `uuencode' on all files prior to packing.  The
  219.      recipient must have `uudecode' and `compress' (used with `-d') in
  220.      order to unpack.  Option `-C' is a synonymous for `-Z', but is
  221.      deprecated.
  222.      Usage of `-Z' in net shars will cause you to be flamed off the
  223.      earth.
  224. `-b BITS'
  225. `--bits-per-code=BITS'
  226.      When doing compression, use `-bX' as a parameter to `compress'.
  227.      The `-B' option turns on the `-Z' option by default.  The default
  228.      value is 12, foreseeing the memory limitations of some `compress'
  229.      programs on smallish systems, at `unshar' time.
  230. File: sharutils.info,  Node: Transmission,  Next: Kinds,  Prev: Stocking,  Up: shar invocation
  231. Protecting against transmission errors
  232. ======================================
  233. `--no-character-count'
  234.      Do *not* check with `wc -c' after unpack. The default is to check.
  235. `--force-prefix'
  236.      Prepend the prefix character to every line even if not required.
  237.      This option may slightly increase the size of the archive,
  238.      especially if `-B' or `-Z' is used.  Normally, the prefix character
  239.      is `X'.  If the parameter to the `-d' option starts with `X', then
  240.      the prefix character becomes `Y'.
  241. `-d STRING'
  242. `--here-delimiter=STRING'
  243.      Use STRING to delimit the files in the shar instead of `SHAR_EOF'.
  244.      This is for those who want to personalize their shar files.
  245. File: sharutils.info,  Node: Kinds,  Prev: Transmission,  Up: shar invocation
  246. Producing different kinds of shars
  247. ==================================
  248. `--vanilla-operation'
  249.      This option produces "vanilla" shars which rely only upon the
  250.      existence of `echo', `test' and `sed' in the unpacking environment.
  251.      The `-V' disables options offensive to the "network cop" (or
  252.      "brown shirt").  It also changes the default from mixed mode `-M'
  253.      to text mode `-T'.  Warnings are produced if option `-B', `-z',
  254.      `-Z', `-p' or `-M' is specified (any of which does or might
  255.      require `uudecode', `gzip' or `compress' in the unpacking
  256.      environment).
  257. `--no-piping'
  258.      In the shar file, use a temporary file to hold the file to
  259.      `uudecode', instead of using pipes.  This option is mandatory when
  260.      you know the unpacking `uudecode' is unwilling to merely read its
  261.      standard input.  Richard Marks wrote what is certainly the most
  262.      (in)famous of these, for MSDOS :-).
  263.      (Here is a side note from the maintainer.  Why isnt't this option
  264.      the default?  In the past history of `shar', it was decided that
  265.      piping was better, surely because it is less demanding on disk
  266.      space, and people seem to be happy with this.  Besides, I think
  267.      that the `uudecode' from Richard Marks, on MSDOS, is wrong in
  268.      refusing to handle stdin.  So far that I remember, he has the
  269.      strong opinion that a program without any parameters should give
  270.      its `--help' output.  Besides that, should I say, his `uuencode'
  271.      and `uudecode' programs are full-featured, one of the most
  272.      complete set I ever saw.  But Richard will not release his
  273.      sources, he wants to stay in control.)
  274. `--no-check-existing'
  275.      Overwrite existing files without checking.  If neither `-x' nor
  276.      `-X' is specified, when unpacking itself, the shell archive will
  277.      check for and not overwrite existing files (unless `-c' is passed
  278.      as a parameter to the script when unpacking).
  279. `--query-user'
  280.      Interactively overwrite existing files.
  281.      Use of `-X' produces shars which *will* cause problems with some
  282.      `unshar'-style procedures, particularily when used together with
  283.      vanilla mode (`-V').  Use this feature mainly for archives to be
  284.      passed among agreeable parties.  Certainly, `-X' is *not* for
  285.      shell archives which are to be submitted to Usenet or other public
  286.      networks.
  287.      The problem is that `unshar' programs or procedures often feed
  288.      `/bin/sh' from its standard input, thus putting `/bin/sh' and the
  289.      shell archive script in competition for input lines.  As an
  290.      attempt to alleviate this problem, `shar' will try to detect if
  291.      `/dev/tty' exists at the receiving site and will use it to read
  292.      user replies.  But this does not work in all cases, it may happen
  293.      that the receiving user will have to avoid using `unshar' programs
  294.      or procedures, and call `/bin/sh' directly.  In vanilla mode,
  295.      using `/dev/tty' is not even attempted.
  296. `--no-timestamp'
  297.      Avoid generating `touch' commands to restore the file modification
  298.      dates when unpacking files from the archive.
  299.      When the timestamp relationship is not preserved, some files like
  300.      `configure' or `*.info' may be uselessly remade after unpacking.
  301.      This is why, when this option is not used, a special effort is
  302.      made to restore timestamps,
  303. `--quiet-unshar'
  304.      Verbose *off* at `unshar' time.  Disables the inclusion of
  305.      comments to be output when the archive is unpacked.
  306. `--basename'
  307.      Use only the last filename component of each input file name,
  308.      ignoring any prefix directories.  This is sometimes useful when
  309.      building a shar from several directories, or another directory.
  310.      If a directory name is passed to `shar', the substructure of that
  311.      directory will be restored whether `-f' is specified or not.
  312. File: sharutils.info,  Node: unshar invocation,  Next: Miscellaneous,  Prev: shar invocation,  Up: Top
  313. Invoking the `unshar' program
  314. *****************************
  315.    The format of the `unshar' command is:
  316.      unshar [ OPTION ] ... [ FILE ... ]
  317.    Each FILE is processed in turn, as a shell archive or a collection
  318. of shell archives.  If no files are given, then standard input is
  319. processed instead.
  320.    Options:
  321. `--version'
  322.      Print the version number of the program on standard output, then
  323.      immediately exits.
  324. `--help'
  325.      Print an help summary on standard output, then immediately exits.
  326. `-d DIRECTORY'
  327. `--directory=DIRECTORY'
  328.      Change directory to DIRECTORY before unpacking any files.
  329. `--overwrite'
  330.      Passed as an option to the shar file.  Many shell archive scripts
  331.      (including those produced by `shar' 3.40 and newer) accepts a `-c'
  332.      argument to indicate that existing files should be overwritten.
  333. `--exit-0'
  334.      This option exists mainly for people who collect many shell
  335.      archives into a single mail folder.  With this option, `unshar'
  336.      isolates each different shell archive from the others which have
  337.      been put in the same file, unpacking each in in turn, from the
  338.      beginning of the file towards its end.  Its proper operation
  339.      relies on the fact that many shar files are terminated by a
  340.      `exit 0' at the beginning of a line.
  341.      Option `-e' is internally equivalent to `-E "exit 0"'.
  342. `-E STRING'
  343. `--split-at=STRING'
  344.      This option works like `-e', but it allows you to specify the
  345.      string that separates archives if `exit 0' isn't appropriate.
  346.      For example, noticing that most `.signatures' have a `--' on a
  347.      line right before them, one can sometimes use `--split-at=--' for
  348.      splitting shell archives which lack the `exit 0' line at end.  The
  349.      signature will then be skipped altogether with the headers of the
  350.      following message.
  351. File: sharutils.info,  Node: Miscellaneous,  Prev: unshar invocation,  Up: Top
  352. Miscellaneous considerations
  353. ****************************
  354.    Here is a place-holder for many considerations which do not fit
  355. elsewhere, while not worth a section for themselves.
  356.    Be careful that the output file(s) are not included in the inputs or
  357. `shar' may loop until the disk fills up.  Be particularly careful when
  358. a directory is passed to `shar' that the output files are not in that
  359. directory (or a subdirectory of that directory).
  360.    When a directory is passed to `shar', it may be scanned more than
  361. once, to conserve memory.  Therefore, one should be careful to not
  362. change the directory contents while `shar' is running.
  363.    No attempt is made to restore the protection and modification dates
  364. for directories, even if this is done by default for files.  Thus, if a
  365. directory is given to `shar', the protection and modification dates of
  366. corresponding unpacked directory may not match those of the original.
  367.    Use of the `-M' or `-B' options will slow down the archive process.
  368. Use of the `-z' or `-Z' options may slow the archive process
  369. considerably.
  370.    Let us conclude by a showing a few examples of `shar' usage:
  371.      shar *.c > cprog.shar
  372.      shar -v *.[ch] > cprog.shar
  373.      shar -B -l28 -oarc.sh. *.arc
  374.      shar -f /lcl/src/u*.c > u.sh
  375. The first shows how to make a shell archive out of all C program
  376. sources.  The second produces a shell archive with all `.c' and `.h'
  377. files, which unpacks silently.  The third gives a shell archive of all
  378. uuencoded `.arc' files, into files `arc.sh.01' through to `arc.sh.NNN'.
  379. The last example gives a shell archive which will use only the file
  380. names at unpack time.
  381. Tag Table:
  382. Node: Top
  383. Node: Introduction
  384. Node: shar invocation
  385. Node: Selecting
  386. Node: Splitting
  387. Node: Headers
  388. Node: Stocking
  389. Node: Transmission
  390. 11816
  391. Node: Kinds
  392. 12611
  393. Node: unshar invocation
  394. 16558
  395. Node: Miscellaneous
  396. 18498
  397. End Tag Table
  398.