home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / sharutils.info < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  20.0 KB  |  545 lines

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