home *** CD-ROM | disk | FTP | other *** search
- Since I tore the comments out of the code, and it is not customary to send
- SCCS files around the net, I made this auxiliary file of documentation.
-
- An alphabetical list of variables, their use and meaning:
-
- AR = argument
- CM = command line
- CO = compress program may be arc, etc.
- DB = Debug level (Verbosity level)
- DE = Delay between pieces
- FC = file count
- FL = File list (build up file list from params on command line in
- FL = any order (see /usr/bin/spell) for a good example of obfuscated,
- FL = clever parsing code
- LI = the number of lines to split pieces into
- MA = mail transport agent
- ME = the name of the program running
- MF = Mail flags to send to transport
- R = range of pieces to be re-sent during parse stage
- RA = range of pieces to be re-sent if mailers on the way failed
- SE = send flag; if true, send the piece. If false, don't
- SP = the name of the split program
- SU = subject of message (defaults to first file name)
- T1 = temporary file containing output of tar and compress.
- T2 = temporary file containing uuencoded stuff
- T3 = temporary file(s) containing split pieces
- TA = tar program (may be shar, tar, cat, etc ;-)
- TD = Temporary directory in which temp files should go can be . or /tmp.
- TM = Test-mode flag (-n option of make) Don't do anything, just
- TM = echo what you would have done if testmode option not on.
- TO = recipient(s) of message
- UU = the uuencode program (may be replaced with btoa / atob ;-)
- VE = version number
- f = file name (piece) during loop which sends pieces
- i = a loop index used during parse of the range of files to be re-sent
- max= The loop-limit used in parse of range of files to be re-sent
- max= is assumed to be 99 if no top-of-range is given.
- n = piece number during the loop which sends pieces via mail
- ne = next param on command line (after flag is set, next param gets
- ne = eval'd to the var set in ne (see above)
- t = a specific token containing a range to be expanded (n-m)
- tok= Token during parse of range of files to be re-sent
-
-
- History:
- # Coder Date Comments
- #------------ -------- ---------------------------------------------------
- # M F Wyle 02nov87 Shamelessly stolen from tarmail :-)
- # WRU 18feb88 changed variable MAILER, added SPLITTER,
- # LINES, USER and a warning about uudecode
- # M F Wyle 25mar88 Add tar, extract join-script in 1st msg
- # WRU 03apr88 fixed some quoting problems in "echo"-strings
- # cosmetic changes: renamed "mailsplit"
- # created THISNAME
- # fixed some typos, added Email-addresses, example,
- # section for suggested improvements
- # MFW 05apr88 Fix more quoting problems in echo strings (shell
- # variables); added /bin/rm cleanup to join-script
- # MFW 21jun88 based on WRU's suggestions:
- # 1) add file-name to subject
- # 2) verbose explanations
- # 3) add parts-order checking! Yippeee!
- # MFW 08jul88 Fix uudecode setuid bug
- # MFW 12jul88 Fix empty or no files bug, added FILECOUNT
- # MFW 17jul88 Added umask 0, delay before mail, check after split
- # MFW 19jul88 Major re-write for flags, verbose, sccs control
- # MFW 25jul88 Added a range-parser, more flags, some documentation
- # Up'd release to 2.0 for distribution
-
- Verbal description of algorithm:
- ====== =========== == ==========
- When the program starts, it initializes some variables, then parses the
- entire command line. It builds up a list of non-flag options in the F
- variable. The first parameter in F is the e-mail path. All others are
- files or directories.
-
- If no subject is set via the "-s subject" flag, the subect is assigned
- from the first file to send. The three temporary file names (variables
- T1, T2, and T3) are then assigned.
-
- The range of pieces to be re-sent is parsed.
-
- Debugging output is echo'd to standard out as appropriate for the
- debugging level. If the -t or -n option is set, nothing is really
- done, except printing out what would have happened.
-
- The tar, compress, split commands are performed, with appropriate
- verbosity for the debugging level. Certain checks are made along the
- way to verify that the commands did not fail. If one fails, the
- program exits with an appropriate failure message.
-
- The files created in $T3* are sent via mail one at a time, with
- delays. The first file sent has a join-script pre-pended. A file
- counter $n is used to label the subject lines.
-
- The temporary files are deleted.
-
-