Hex Artifact Content
Not logged in

Artifact a78df15c2ea389c7cfd8911e94fa5c9ba80bbbe1:


0000: 23 21 2f 75 73 72 2f 62 69 6e 2f 65 6e 76 20 62  #!/usr/bin/env b
0010: 61 73 68 0a 23 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ash.#===========
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0050: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a  ===============.
0060: 23 0a 23 20 43 6f 70 79 72 69 67 68 74 20 32 30  #.# Copyright 20
0070: 31 36 2c 20 6d 61 72 74 69 6e 2e 76 61 68 69 40  16, martin.vahi@
0080: 73 6f 66 74 66 31 2e 63 6f 6d 20 74 68 61 74 20  softf1.com that 
0090: 68 61 73 20 61 6e 0a 23 20 45 73 74 6f 6e 69 61  has an.# Estonia
00a0: 6e 20 70 65 72 73 6f 6e 61 6c 20 69 64 65 6e 74  n personal ident
00b0: 69 66 69 63 61 74 69 6f 6e 20 63 6f 64 65 20 6f  ification code o
00c0: 66 20 33 38 31 30 38 30 35 30 30 32 30 2e 0a 23  f 38108050020..#
00d0: 20 41 6c 6c 20 72 69 67 68 74 73 20 72 65 73 65   All rights rese
00e0: 72 76 65 64 2e 0a 23 0a 23 20 52 65 64 69 73 74  rved..#.# Redist
00f0: 72 69 62 75 74 69 6f 6e 20 61 6e 64 20 75 73 65  ribution and use
0100: 20 69 6e 20 73 6f 75 72 63 65 20 61 6e 64 20 62   in source and b
0110: 69 6e 61 72 79 20 66 6f 72 6d 73 2c 20 77 69 74  inary forms, wit
0120: 68 20 6f 72 0a 23 20 77 69 74 68 6f 75 74 20 6d  h or.# without m
0130: 6f 64 69 66 69 63 61 74 69 6f 6e 2c 20 61 72 65  odification, are
0140: 20 70 65 72 6d 69 74 74 65 64 20 70 72 6f 76 69   permitted provi
0150: 64 65 64 20 74 68 61 74 20 74 68 65 20 66 6f 6c  ded that the fol
0160: 6c 6f 77 69 6e 67 0a 23 20 63 6f 6e 64 69 74 69  lowing.# conditi
0170: 6f 6e 73 20 61 72 65 20 6d 65 74 3a 0a 23 0a 23  ons are met:.#.#
0180: 20 2a 20 52 65 64 69 73 74 72 69 62 75 74 69 6f   * Redistributio
0190: 6e 73 20 6f 66 20 73 6f 75 72 63 65 20 63 6f 64  ns of source cod
01a0: 65 20 6d 75 73 74 20 72 65 74 61 69 6e 20 74 68  e must retain th
01b0: 65 20 61 62 6f 76 65 20 63 6f 70 79 72 69 67 68  e above copyrigh
01c0: 74 0a 23 20 20 20 6e 6f 74 69 63 65 2c 20 74 68  t.#   notice, th
01d0: 69 73 20 6c 69 73 74 20 6f 66 20 63 6f 6e 64 69  is list of condi
01e0: 74 69 6f 6e 73 20 61 6e 64 20 74 68 65 20 66 6f  tions and the fo
01f0: 6c 6c 6f 77 69 6e 67 20 64 69 73 63 6c 61 69 6d  llowing disclaim
0200: 65 72 2e 0a 23 20 2a 20 52 65 64 69 73 74 72 69  er..# * Redistri
0210: 62 75 74 69 6f 6e 73 20 69 6e 20 62 69 6e 61 72  butions in binar
0220: 79 20 66 6f 72 6d 20 6d 75 73 74 20 72 65 70 72  y form must repr
0230: 6f 64 75 63 65 20 74 68 65 20 61 62 6f 76 65 20  oduce the above 
0240: 63 6f 70 79 72 69 67 68 74 0a 23 20 20 20 6e 6f  copyright.#   no
0250: 74 69 63 65 2c 20 74 68 69 73 20 6c 69 73 74 20  tice, this list 
0260: 6f 66 20 63 6f 6e 64 69 74 69 6f 6e 73 20 61 6e  of conditions an
0270: 64 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  d the following 
0280: 64 69 73 63 6c 61 69 6d 65 72 0a 23 20 20 20 69  disclaimer.#   i
0290: 6e 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 61 74  n the documentat
02a0: 69 6f 6e 20 61 6e 64 2f 6f 72 20 6f 74 68 65 72  ion and/or other
02b0: 20 6d 61 74 65 72 69 61 6c 73 20 70 72 6f 76 69   materials provi
02c0: 64 65 64 20 77 69 74 68 20 74 68 65 0a 23 20 20  ded with the.#  
02d0: 20 64 69 73 74 72 69 62 75 74 69 6f 6e 2e 0a 23   distribution..#
02e0: 20 2a 20 4e 65 69 74 68 65 72 20 74 68 65 20 6e   * Neither the n
02f0: 61 6d 65 20 6f 66 20 74 68 65 20 4d 61 72 74 69  ame of the Marti
0300: 6e 20 56 61 68 69 20 6e 6f 72 20 74 68 65 20 6e  n Vahi nor the n
0310: 61 6d 65 73 20 6f 66 20 69 74 73 0a 23 20 20 20  ames of its.#   
0320: 63 6f 6e 74 72 69 62 75 74 6f 72 73 20 6d 61 79  contributors may
0330: 20 62 65 20 75 73 65 64 20 74 6f 20 65 6e 64 6f   be used to endo
0340: 72 73 65 20 6f 72 20 70 72 6f 6d 6f 74 65 20 70  rse or promote p
0350: 72 6f 64 75 63 74 73 20 64 65 72 69 76 65 64 0a  roducts derived.
0360: 23 20 20 20 66 72 6f 6d 20 74 68 69 73 20 73 6f  #   from this so
0370: 66 74 77 61 72 65 20 77 69 74 68 6f 75 74 20 73  ftware without s
0380: 70 65 63 69 66 69 63 20 70 72 69 6f 72 20 77 72  pecific prior wr
0390: 69 74 74 65 6e 20 70 65 72 6d 69 73 73 69 6f 6e  itten permission
03a0: 2e 0a 23 0a 23 20 54 48 49 53 20 53 4f 46 54 57  ..#.# THIS SOFTW
03b0: 41 52 45 20 49 53 20 50 52 4f 56 49 44 45 44 20  ARE IS PROVIDED 
03c0: 42 59 20 54 48 45 20 43 4f 50 59 52 49 47 48 54  BY THE COPYRIGHT
03d0: 20 48 4f 4c 44 45 52 53 20 41 4e 44 0a 23 20 43   HOLDERS AND.# C
03e0: 4f 4e 54 52 49 42 55 54 4f 52 53 20 22 41 53 20  ONTRIBUTORS "AS 
03f0: 49 53 22 20 41 4e 44 20 41 4e 59 20 45 58 50 52  IS" AND ANY EXPR
0400: 45 53 53 20 4f 52 20 49 4d 50 4c 49 45 44 20 57  ESS OR IMPLIED W
0410: 41 52 52 41 4e 54 49 45 53 2c 0a 23 20 49 4e 43  ARRANTIES,.# INC
0420: 4c 55 44 49 4e 47 2c 20 42 55 54 20 4e 4f 54 20  LUDING, BUT NOT 
0430: 4c 49 4d 49 54 45 44 20 54 4f 2c 20 54 48 45 20  LIMITED TO, THE 
0440: 49 4d 50 4c 49 45 44 20 57 41 52 52 41 4e 54 49  IMPLIED WARRANTI
0450: 45 53 20 4f 46 0a 23 20 4d 45 52 43 48 41 4e 54  ES OF.# MERCHANT
0460: 41 42 49 4c 49 54 59 20 41 4e 44 20 46 49 54 4e  ABILITY AND FITN
0470: 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43  ESS FOR A PARTIC
0480: 55 4c 41 52 20 50 55 52 50 4f 53 45 20 41 52 45  ULAR PURPOSE ARE
0490: 0a 23 20 44 49 53 43 4c 41 49 4d 45 44 2e 20 49  .# DISCLAIMED. I
04a0: 4e 20 4e 4f 20 45 56 45 4e 54 20 53 48 41 4c 4c  N NO EVENT SHALL
04b0: 20 54 48 45 20 43 4f 50 59 52 49 47 48 54 20 48   THE COPYRIGHT H
04c0: 4f 4c 44 45 52 20 4f 52 0a 23 20 43 4f 4e 54 52  OLDER OR.# CONTR
04d0: 49 42 55 54 4f 52 53 20 42 45 20 4c 49 41 42 4c  IBUTORS BE LIABL
04e0: 45 20 46 4f 52 20 41 4e 59 20 44 49 52 45 43 54  E FOR ANY DIRECT
04f0: 2c 20 49 4e 44 49 52 45 43 54 2c 20 49 4e 43 49  , INDIRECT, INCI
0500: 44 45 4e 54 41 4c 2c 0a 23 20 53 50 45 43 49 41  DENTAL,.# SPECIA
0510: 4c 2c 20 45 58 45 4d 50 4c 41 52 59 2c 20 4f 52  L, EXEMPLARY, OR
0520: 20 43 4f 4e 53 45 51 55 45 4e 54 49 41 4c 20 44   CONSEQUENTIAL D
0530: 41 4d 41 47 45 53 20 28 49 4e 43 4c 55 44 49 4e  AMAGES (INCLUDIN
0540: 47 2c 0a 23 20 42 55 54 20 4e 4f 54 20 4c 49 4d  G,.# BUT NOT LIM
0550: 49 54 45 44 20 54 4f 2c 20 50 52 4f 43 55 52 45  ITED TO, PROCURE
0560: 4d 45 4e 54 20 4f 46 20 53 55 42 53 54 49 54 55  MENT OF SUBSTITU
0570: 54 45 20 47 4f 4f 44 53 20 4f 52 0a 23 20 53 45  TE GOODS OR.# SE
0580: 52 56 49 43 45 53 3b 20 4c 4f 53 53 20 4f 46 20  RVICES; LOSS OF 
0590: 55 53 45 2c 20 44 41 54 41 2c 20 4f 52 20 50 52  USE, DATA, OR PR
05a0: 4f 46 49 54 53 3b 20 4f 52 20 42 55 53 49 4e 45  OFITS; OR BUSINE
05b0: 53 53 0a 23 20 49 4e 54 45 52 52 55 50 54 49 4f  SS.# INTERRUPTIO
05c0: 4e 29 20 48 4f 57 45 56 45 52 20 43 41 55 53 45  N) HOWEVER CAUSE
05d0: 44 20 41 4e 44 20 4f 4e 20 41 4e 59 20 54 48 45  D AND ON ANY THE
05e0: 4f 52 59 20 4f 46 20 4c 49 41 42 49 4c 49 54 59  ORY OF LIABILITY
05f0: 2c 0a 23 20 57 48 45 54 48 45 52 20 49 4e 20 43  ,.# WHETHER IN C
0600: 4f 4e 54 52 41 43 54 2c 20 53 54 52 49 43 54 20  ONTRACT, STRICT 
0610: 4c 49 41 42 49 4c 49 54 59 2c 20 4f 52 20 54 4f  LIABILITY, OR TO
0620: 52 54 20 28 49 4e 43 4c 55 44 49 4e 47 0a 23 20  RT (INCLUDING.# 
0630: 4e 45 47 4c 49 47 45 4e 43 45 20 4f 52 20 4f 54  NEGLIGENCE OR OT
0640: 48 45 52 57 49 53 45 29 20 41 52 49 53 49 4e 47  HERWISE) ARISING
0650: 20 49 4e 20 41 4e 59 20 57 41 59 20 4f 55 54 20   IN ANY WAY OUT 
0660: 4f 46 20 54 48 45 20 55 53 45 0a 23 20 4f 46 20  OF THE USE.# OF 
0670: 54 48 49 53 20 53 4f 46 54 57 41 52 45 2c 20 45  THIS SOFTWARE, E
0680: 56 45 4e 20 49 46 20 41 44 56 49 53 45 44 20 4f  VEN IF ADVISED O
0690: 46 20 54 48 45 20 50 4f 53 53 49 42 49 4c 49 54  F THE POSSIBILIT
06a0: 59 20 4f 46 20 53 55 43 48 20 44 41 4d 41 47 45  Y OF SUCH DAMAGE
06b0: 2e 0a 23 0a 23 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..#.#.#---------
06c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
06d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
06e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
06f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0700: 2d 0a 23 20 54 4f 44 4f 3a 20 0a 23 20 20 20 20  -.# TODO: .#    
0710: 20 44 75 65 20 74 6f 20 74 68 65 20 64 75 6d 62   Due to the dumb
0720: 20 72 65 2d 69 6e 69 74 69 61 6c 69 7a 61 74 69   re-initializati
0730: 6f 6e 20 6f 66 20 74 68 65 20 77 68 6f 6c 65 20  on of the whole 
0740: 0a 23 20 20 20 20 20 52 75 62 79 20 69 6e 74 65  .#     Ruby inte
0750: 72 70 72 65 74 65 72 20 66 6f 72 20 65 76 65 72  rpreter for ever
0760: 79 20 73 6d 61 6c 6c 20 73 74 72 69 6e 67 20 6f  y small string o
0770: 70 65 72 61 74 69 6f 6e 20 69 6e 20 74 68 69 73  peration in this
0780: 20 73 63 72 69 70 74 2c 0a 23 20 20 20 20 20 74   script,.#     t
0790: 68 65 20 63 75 72 72 65 6e 74 20 76 65 72 73 69  he current versi
07a0: 6f 6e 20 6f 66 20 74 68 69 73 20 73 63 72 69 70  on of this scrip
07b0: 74 20 69 73 20 74 65 72 72 69 62 6c 79 20 73 6c  t is terribly sl
07c0: 6f 77 2e 0a 23 20 20 20 20 20 49 74 20 63 6f 75  ow..#     It cou
07d0: 6c 64 20 62 65 20 66 61 73 74 65 72 2c 20 69 66  ld be faster, if
07e0: 20 67 61 77 6b 2f 61 77 6b 20 77 65 72 65 20 75   gawk/awk were u
07f0: 73 65 64 2c 20 62 75 74 20 74 68 65 20 0a 23 20  sed, but the .# 
0800: 20 20 20 20 67 61 77 6b 2f 61 77 6b 20 68 61 73      gawk/awk has
0810: 20 62 65 65 6e 20 69 6e 74 65 6e 74 69 6f 6e 61   been intentiona
0820: 6c 6c 79 20 74 68 72 6f 77 6e 20 6f 75 74 2c 20  lly thrown out, 
0830: 62 65 63 61 75 73 65 20 74 68 65 20 67 61 77 6b  because the gawk
0840: 20 61 6e 64 20 61 77 6b 20 0a 23 20 20 20 20 20   and awk .#     
0850: 62 65 68 61 76 65 20 64 69 66 66 65 72 65 6e 74  behave different
0860: 6c 79 20 66 72 6f 6d 20 65 61 63 68 20 6f 74 68  ly from each oth
0870: 65 72 2e 20 4f 6e 20 42 53 44 20 74 68 65 72 65  er. On BSD there
0880: 20 74 65 6e 64 73 20 74 6f 20 62 65 20 6f 6e 6c   tends to be onl
0890: 79 20 22 61 77 6b 22 2c 0a 23 20 20 20 20 20 77  y "awk",.#     w
08a0: 68 69 6c 65 20 74 68 65 20 4c 69 6e 75 78 20 74  hile the Linux t
08b0: 65 6e 64 73 20 74 6f 20 68 61 76 65 20 6f 6e 6c  ends to have onl
08c0: 79 20 74 68 65 20 22 67 61 77 6b 22 2e 0a 23 20  y the "gawk"..# 
08d0: 20 20 20 20 41 74 20 73 6f 6d 65 20 70 6f 69 6e      At some poin
08e0: 74 20 6d 6f 73 74 20 6f 66 20 74 68 69 73 20 73  t most of this s
08f0: 63 72 69 70 74 20 6d 75 73 74 20 62 65 20 72 65  cript must be re
0900: 2d 77 72 69 74 74 65 6e 2c 20 72 65 69 6d 70 6c  -written, reimpl
0910: 65 6d 65 6e 74 65 64 2c 20 0a 23 20 20 20 20 20  emented, .#     
0920: 69 6e 20 73 6f 6d 65 74 68 69 6e 67 20 6d 6f 72  in something mor
0930: 65 20 61 64 76 61 6e 63 65 64 20 74 68 61 6e 20  e advanced than 
0940: 42 61 73 68 2e 20 4d 6f 73 74 20 6c 69 6b 65 6c  Bash. Most likel
0950: 79 20 52 75 62 79 2e 20 0a 23 0a 23 20 20 20 20  y Ruby. .#.#    
0960: 20 54 68 65 20 6e 65 65 64 20 66 6f 72 20 74 68   The need for th
0970: 65 20 72 65 77 72 69 74 65 20 63 6f 6d 65 73 20  e rewrite comes 
0980: 6d 61 69 6e 6c 79 20 66 72 6f 6d 20 74 68 65 20  mainly from the 
0990: 66 61 63 74 20 74 68 61 74 20 0a 23 20 20 20 20  fact that .#    
09a0: 20 74 68 65 20 70 61 73 73 69 6e 67 20 6f 66 20   the passing of 
09b0: 73 74 72 69 6e 67 20 76 61 6c 75 65 73 20 61 73  string values as
09c0: 20 63 6f 6e 73 6f 6c 65 20 70 61 72 61 6d 65 74   console paramet
09d0: 65 72 73 20 0a 23 20 20 20 20 20 72 75 6e 73 20  ers .#     runs 
09e0: 69 6e 74 6f 20 74 68 65 20 63 6c 61 73 73 69 63  into the classic
09f0: 61 6c 20 6d 61 63 72 6f 20 70 72 6f 63 65 73 73  al macro process
0a00: 69 6e 67 20 72 65 6c 61 74 65 64 20 70 72 6f 62  ing related prob
0a10: 6c 65 6d 73 2e 20 0a 23 20 20 20 20 20 54 68 65  lems. .#     The
0a20: 20 73 6c 6f 77 6e 65 73 73 20 69 6e 20 74 68 65   slowness in the
0a30: 20 6e 61 6d 65 20 6f 66 20 70 6f 72 74 61 62 69   name of portabi
0a40: 6c 69 74 79 20 61 6e 64 20 63 6f 72 72 65 63 74  lity and correct
0a50: 6e 65 73 73 20 0a 23 20 20 20 20 20 6f 66 20 74  ness .#     of t
0a60: 68 69 73 2c 20 66 69 72 73 74 2c 20 72 65 66 65  his, first, refe
0a70: 72 65 6e 63 65 20 69 6d 70 6c 65 6d 65 6e 74 61  rence implementa
0a80: 74 69 6f 6e 2c 20 0a 23 20 20 20 20 20 63 61 6e  tion, .#     can
0a90: 20 62 65 20 74 6f 6c 65 72 61 74 65 64 20 66 6f   be tolerated fo
0aa0: 72 20 61 20 77 68 69 6c 65 2e 20 54 68 65 20 72  r a while. The r
0ab0: 65 61 73 6f 6e 2c 20 77 68 79 20 74 68 69 73 20  eason, why this 
0ac0: 73 63 72 69 70 74 20 68 61 73 20 62 65 65 6e 0a  script has been.
0ad0: 23 20 20 20 20 20 77 72 69 74 74 65 6e 20 69 6e  #     written in
0ae0: 20 42 61 73 68 20 61 74 20 66 69 72 73 74 20 70   Bash at first p
0af0: 6c 61 63 65 20 69 73 20 74 68 61 74 20 61 74 20  lace is that at 
0b00: 66 69 72 73 74 20 74 68 65 20 67 6f 61 6c 20 77  first the goal w
0b10: 61 73 20 74 6f 20 0a 23 20 20 20 20 20 74 72 79  as to .#     try
0b20: 20 74 6f 20 63 72 65 61 74 65 20 73 6f 6d 65 74   to create somet
0b30: 68 69 6e 67 20 76 65 72 79 20 22 73 69 6d 70 6c  hing very "simpl
0b40: 65 22 2c 20 73 6f 6d 65 74 68 69 6e 67 20 74 68  e", something th
0b50: 61 74 0a 23 20 20 20 20 20 64 65 70 65 6e 64 73  at.#     depends
0b60: 20 6f 6e 6c 79 20 6f 6e 20 70 72 6f 67 72 61 6d   only on program
0b70: 73 20 74 68 61 74 20 61 72 65 20 76 65 72 79 20  s that are very 
0b80: 6c 69 6b 65 6c 79 20 61 76 61 69 6c 61 62 6c 65  likely available
0b90: 0a 23 20 20 20 20 20 6f 6e 20 50 41 54 48 2c 20  .#     on PATH, 
0ba0: 62 75 74 20 61 73 20 69 74 20 74 75 72 6e 73 20  but as it turns 
0bb0: 6f 75 74 2c 20 74 68 65 20 76 61 72 69 6f 75 73  out, the various
0bc0: 20 74 65 73 74 73 20 61 6e 64 20 0a 23 20 20 20   tests and .#   
0bd0: 20 20 73 74 72 69 6e 67 20 70 72 6f 63 65 73 73    string process
0be0: 69 6e 67 20 61 6e 64 20 6f 74 68 65 72 20 6f 70  ing and other op
0bf0: 65 72 61 74 69 6f 6e 73 20 72 65 71 75 69 72 65  erations require
0c00: 20 0a 23 20 20 20 20 20 71 75 69 74 65 20 61 20   .#     quite a 
0c10: 6c 6f 74 20 6f 66 20 6d 6f 72 65 20 61 64 76 61  lot of more adva
0c20: 6e 63 65 64 20 74 6f 6f 6c 73 20 74 68 61 6e 20  nced tools than 
0c30: 74 68 65 20 42 61 73 68 20 69 73 2c 20 73 6f 0a  the Bash is, so.
0c40: 23 20 20 20 20 20 74 68 65 20 73 69 6d 70 6c 69  #     the simpli
0c50: 63 69 74 79 20 61 6e 64 20 73 68 6f 72 74 20 73  city and short s
0c60: 74 61 72 74 2d 75 70 20 74 69 6d 65 20 68 61 73  tart-up time has
0c70: 20 62 65 65 6e 20 74 6f 74 61 6c 6c 79 0a 23 20   been totally.# 
0c80: 20 20 20 20 6c 6f 73 74 20 61 6e 64 20 74 68 65      lost and the
0c90: 20 63 75 72 72 65 6e 74 20 73 63 72 69 70 74 20   current script 
0ca0: 62 65 61 72 73 20 61 20 68 65 61 76 79 20 70 65  bears a heavy pe
0cb0: 6e 61 6c 74 79 20 66 72 6f 6d 20 0a 23 20 20 20  nalty from .#   
0cc0: 20 20 74 68 65 20 72 65 6c 61 74 69 76 65 6c 79    the relatively
0cd0: 20 68 75 67 65 20 6e 75 6d 62 65 72 20 6f 66 20   huge number of 
0ce0: 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d  operating system
0cf0: 20 70 72 6f 63 65 73 73 20 73 74 61 72 74 2d 75   process start-u
0d00: 70 73 2c 0a 23 20 20 20 20 20 69 6e 63 6c 75 64  ps,.#     includ
0d10: 69 6e 67 20 74 68 65 20 72 65 6c 61 74 69 76 65  ing the relative
0d20: 6c 79 20 68 75 67 65 20 6e 75 6d 62 65 72 20 6f  ly huge number o
0d30: 66 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e  f initialization
0d40: 73 20 6f 66 0a 23 20 20 20 20 20 74 68 65 20 52  s of.#     the R
0d50: 75 62 79 20 69 6e 74 65 72 70 72 65 74 65 72 2e  uby interpreter.
0d60: 20 20 20 0a 23 0a 23 20 20 20 20 20 54 68 65 20     .#.#     The 
0d70: 6c 65 73 73 6f 6e 20 74 6f 20 62 65 20 6c 65 61  lesson to be lea
0d80: 72 6e 74 20 66 72 6f 6d 20 74 68 69 73 20 63 61  rnt from this ca
0d90: 73 65 20 69 73 20 74 68 61 74 20 0a 23 20 20 20  se is that .#   
0da0: 20 20 62 65 63 61 75 73 65 20 70 72 6f 6a 65 63    because projec
0db0: 74 73 20 67 65 74 20 66 61 72 20 6d 6f 72 65 20  ts get far more 
0dc0: 63 6f 6d 70 6c 65 78 20 74 68 61 6e 20 0a 23 20  complex than .# 
0dd0: 20 20 20 20 69 6e 69 74 69 61 6c 6c 79 20 61 6e      initially an
0de0: 74 69 63 69 70 61 74 65 64 2c 20 6d 6f 72 65 20  ticipated, more 
0df0: 61 64 76 61 6e 63 65 64 20 70 72 6f 67 72 61 6d  advanced program
0e00: 6d 69 6e 67 20 6c 61 6e 67 75 61 67 65 73 20 0a  ming languages .
0e10: 23 20 20 20 20 20 73 68 6f 75 6c 64 20 62 65 20  #     should be 
0e20: 70 72 65 66 65 72 72 65 64 20 74 6f 20 6c 65 73  preferred to les
0e30: 73 20 61 64 76 61 6e 63 65 64 20 70 72 6f 67 72  s advanced progr
0e40: 61 6d 6d 69 6e 67 20 6c 61 6e 67 75 61 67 65 73  amming languages
0e50: 20 0a 23 20 20 20 20 20 66 72 6f 6d 20 74 68 65   .#     from the
0e60: 20 76 65 72 79 20 73 74 61 72 74 20 6f 66 20 74   very start of t
0e70: 68 65 20 70 72 6f 6a 65 63 74 2e 20 54 68 65 20  he project. The 
0e80: 63 75 72 72 65 6e 74 20 63 61 73 65 20 68 65 72  current case her
0e90: 65 0a 23 20 20 20 20 20 73 65 65 6d 73 20 74 6f  e.#     seems to
0ea0: 20 62 65 20 61 20 6d 6f 72 65 20 68 69 67 68 20   be a more high 
0eb0: 6c 65 76 65 6c 20 76 65 72 73 69 6f 6e 20 6f 66  level version of
0ec0: 20 74 68 65 20 6d 69 63 72 6f 63 6f 6e 74 72 6f   the microcontro
0ed0: 6c 6c 65 72 20 70 72 6f 6a 65 63 74 73 27 0a 23  ller projects'.#
0ee0: 20 20 20 20 20 61 73 73 65 6d 62 6c 65 72 20 76       assembler v
0ef0: 65 72 73 75 73 20 43 20 64 69 6c 65 6d 6d 61 2e  ersus C dilemma.
0f00: 0a 23 0a 23 0a 23 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  .#.#.#==========
0f10: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0f20: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0f30: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0f40: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0f50: 0a 53 5f 46 50 5f 44 49 52 3d 22 24 28 20 63 64  .S_FP_DIR="$( cd
0f60: 20 22 24 28 20 64 69 72 6e 61 6d 65 20 22 24 7b   "$( dirname "${
0f70: 42 41 53 48 5f 53 4f 55 52 43 45 5b 30 5d 7d 22  BASH_SOURCE[0]}"
0f80: 20 29 22 20 26 26 20 70 77 64 20 29 22 0a 53 5f   )" && pwd )".S_
0f90: 46 50 5f 4f 52 49 47 3d 22 60 70 77 64 60 22 0a  FP_ORIG="`pwd`".
0fa0: 53 5f 54 49 4d 45 53 54 41 4d 50 3d 22 60 64 61  S_TIMESTAMP="`da
0fb0: 74 65 20 2b 25 59 60 5f 60 64 61 74 65 20 2b 25  te +%Y`_`date +%
0fc0: 6d 60 5f 60 64 61 74 65 20 2b 25 64 60 5f 54 5f  m`_`date +%d`_T_
0fd0: 60 64 61 74 65 20 2b 25 48 60 68 5f 60 64 61 74  `date +%H`h_`dat
0fe0: 65 20 2b 25 4d 60 6d 69 6e 5f 60 64 61 74 65 20  e +%M`min_`date 
0ff0: 2b 25 53 60 73 22 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  +%S`s"..#-------
1000: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1040: 2d 2d 2d 0a 23 20 53 65 6d 69 2d 61 75 74 6f 2d  ---.# Semi-auto-
1050: 73 74 61 6d 70 73 3a 0a 0a 23 20 52 45 4e 45 53  stamps:..# RENES
1060: 53 41 41 54 4f 52 5f 42 4c 4f 43 4b 5f 53 54 41  SAATOR_BLOCK_STA
1070: 52 54 0a 23 20 52 45 4e 45 53 53 41 41 54 4f 52  RT.# RENESSAATOR
1080: 5f 42 4c 4f 43 4b 5f 49 44 3d 62 6c 6f 63 6b 5f  _BLOCK_ID=block_
1090: 31 35 64 38 63 33 33 35 2d 62 31 37 37 2d 34 38  15d8c335-b177-48
10a0: 64 30 2d 61 33 64 36 2d 31 32 64 32 36 31 63 30  d0-a3d6-12d261c0
10b0: 33 31 65 37 0a 23 20 52 45 4e 45 53 53 41 41 54  31e7.# RENESSAAT
10c0: 4f 52 5f 53 4f 55 52 43 45 5f 4c 41 4e 47 55 41  OR_SOURCE_LANGUA
10d0: 47 45 3d 52 75 62 79 0a 23 20 52 45 4e 45 53 53  GE=Ruby.# RENESS
10e0: 41 41 54 4f 52 5f 53 4f 55 52 43 45 5f 53 54 41  AATOR_SOURCE_STA
10f0: 52 54 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  RT.# #----------
1100: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1120: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1130: 0a 23 20 66 75 6e 63 5f 74 68 72 6f 77 5f 74 31  .# func_throw_t1
1140: 3d 6c 61 6d 62 64 61 20 64 6f 20 7c 73 5f 69 6e  =lambda do |s_in
1150: 2c 73 5f 67 75 69 64 5f 30 7c 0a 23 20 73 5f 67  ,s_guid_0|.# s_g
1160: 75 69 64 5f 31 3d 22 34 30 31 65 63 36 35 66 2d  uid_1="401ec65f-
1170: 35 62 31 66 2d 34 35 30 34 2d 61 33 37 66 2d 38  5b1f-4504-a37f-8
1180: 30 32 30 37 30 65 30 33 31 65 37 22 0a 23 20 70  02070e031e7".# p
1190: 75 74 73 28 22 5c 6e 22 29 0a 23 20 70 75 74 73  uts("\n").# puts
11a0: 28 22 65 63 68 6f 20 5c 22 5c 22 22 29 0a 23 20  ("echo \"\"").# 
11b0: 70 75 74 73 28 22 65 63 68 6f 20 5c 22 43 6f 64  puts("echo \"Cod
11c0: 65 20 67 65 6e 65 72 61 74 69 6f 6e 20 73 63 72  e generation scr
11d0: 69 70 74 20 66 61 69 6c 65 64 2e 5c 22 20 5c 6e  ipt failed.\" \n
11e0: 22 29 0a 23 20 70 75 74 73 28 22 65 63 68 6f 20  ").# puts("echo 
11f0: 5c 22 47 55 49 44 3d 3d 27 22 2b 73 5f 67 75 69  \"GUID=='"+s_gui
1200: 64 5f 31 2b 22 27 5c 22 3b 20 20 5c 6e 22 29 0a  d_1+"'\";  \n").
1210: 23 20 70 75 74 73 28 22 65 63 68 6f 20 5c 22 47  # puts("echo \"G
1220: 55 49 44 3d 3d 27 22 2b 73 5f 67 75 69 64 5f 30  UID=='"+s_guid_0
1230: 2b 22 27 5c 22 3b 20 20 5c 6e 22 29 0a 23 20 70  +"'\";  \n").# p
1240: 75 74 73 28 22 65 63 68 6f 20 5c 22 5c 22 22 29  uts("echo \"\"")
1250: 0a 23 20 70 75 74 73 28 22 65 78 69 74 20 31 20  .# puts("exit 1 
1260: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
1270: 72 20 5c 6e 22 29 0a 23 20 72 61 69 73 65 28 45  r \n").# raise(E
1280: 78 63 65 70 74 69 6f 6e 2e 6e 65 77 28 22 5c 6e  xception.new("\n
1290: 5c 6e 20 73 5f 69 6e 3d 3d 22 2b 73 5f 69 6e 2b  \n s_in=="+s_in+
12a0: 22 5c 6e 20 47 55 49 44 3d 3d 22 2b 73 5f 67 75  "\n GUID=="+s_gu
12b0: 69 64 5f 30 2b 22 5c 6e 5c 6e 22 29 29 0a 23 20  id_0+"\n\n")).# 
12c0: 65 6e 64 20 23 20 66 75 6e 63 5f 74 68 72 6f 77  end # func_throw
12d0: 5f 74 31 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  _t1.# #---------
12e0: 2d 2d 2d 2d 2d 0a 23 20 23 20 54 68 65 20 70 72  -----.# # The pr
12f0: 6f 62 6c 65 6d 20 69 73 20 74 68 61 74 20 6e 65  oblem is that ne
1300: 69 74 68 65 72 20 74 68 65 20 22 75 75 69 64 22  ither the "uuid"
1310: 2c 20 6e 6f 72 20 74 68 65 20 22 75 75 69 64 67  , nor the "uuidg
1320: 65 6e 22 0a 23 20 23 20 6d 69 67 68 74 20 62 65  en".# # might be
1330: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68   available on th
1340: 65 20 50 41 54 48 2e 20 54 68 65 20 63 72 65 61  e PATH. The crea
1350: 74 69 6f 6e 20 6f 66 20 74 68 65 20 69 6e 69 74  tion of the init
1360: 61 6c 20 76 61 6c 75 65 20 6f 66 20 74 68 65 0a  al value of the.
1370: 23 20 23 20 73 5f 30 20 68 61 73 20 62 65 65 6e  # # s_0 has been
1380: 20 74 65 73 74 65 64 20 6f 6e 20 62 6f 74 68 2c   tested on both,
1390: 20 4c 69 6e 75 78 20 61 6e 64 20 42 53 44 2c 20   Linux and BSD, 
13a0: 62 75 74 20 6e 6f 74 20 77 69 74 68 20 61 6c 6c  but not with all
13b0: 20 73 68 65 6c 6c 73 2e 0a 23 20 73 5f 30 3d 28   shells..# s_0=(
13c0: 60 77 68 69 63 68 20 75 75 69 64 67 65 6e 20 32  `which uuidgen 2
13d0: 3e 2f 64 65 76 2f 6e 75 6c 6c 20 31 3e 2f 64 65  >/dev/null 1>/de
13e0: 76 2f 6e 75 6c 6c 3b 20 65 63 68 6f 20 24 3f 60  v/null; echo $?`
13f0: 29 2e 74 6f 5f 73 0a 23 20 73 5f 30 3d 73 5f 30  ).to_s.# s_0=s_0
1400: 2e 67 73 75 62 28 2f 5b 5c 6e 5c 73 5c 72 5d 2f  .gsub(/[\n\s\r]/
1410: 2c 22 22 29 0a 23 20 73 5f 67 75 69 64 5f 67 65  ,"").# s_guid_ge
1420: 6e 65 72 61 74 69 6f 6e 5f 70 72 6f 67 72 61 6d  neration_program
1430: 5f 6e 61 6d 65 3d 22 23 6e 6f 74 5f 79 65 74 5f  _name="#not_yet_
1440: 73 65 74 22 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d  set".# #--------
1450: 2d 2d 2d 2d 2d 2d 0a 23 20 66 75 6e 63 5f 61 73  ------.# func_as
1460: 73 65 72 74 5f 73 5f 30 5f 66 6f 72 6d 61 74 5f  sert_s_0_format_
1470: 74 31 3d 6c 61 6d 62 64 61 20 64 6f 20 7c 73 5f  t1=lambda do |s_
1480: 69 6e 7c 0a 23 20 69 66 20 28 73 5f 69 6e 21 3d  in|.# if (s_in!=
1490: 22 30 22 29 26 26 28 73 5f 69 6e 21 3d 22 31 22  "0")&&(s_in!="1"
14a0: 29 0a 23 20 73 5f 67 75 69 64 5f 30 3d 22 34 61  ).# s_guid_0="4a
14b0: 32 33 32 63 32 35 2d 38 39 64 62 2d 34 65 63 37  232c25-89db-4ec7
14c0: 2d 62 35 37 66 2d 38 30 32 30 37 30 65 30 33 31  -b57f-802070e031
14d0: 65 37 22 0a 23 20 66 75 6e 63 5f 74 68 72 6f 77  e7".# func_throw
14e0: 5f 74 31 2e 63 61 6c 6c 28 73 5f 69 6e 2c 73 5f  _t1.call(s_in,s_
14f0: 67 75 69 64 5f 30 29 0a 23 20 65 6e 64 20 23 20  guid_0).# end # 
1500: 69 66 0a 23 20 65 6e 64 20 23 20 66 75 6e 63 5f  if.# end # func_
1510: 61 73 73 65 72 74 5f 73 5f 30 5f 66 6f 72 6d 61  assert_s_0_forma
1520: 74 5f 74 31 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d  t_t1.# #--------
1530: 2d 2d 2d 2d 2d 2d 0a 23 20 66 75 6e 63 5f 61 73  ------.# func_as
1540: 73 65 72 74 5f 73 5f 30 5f 66 6f 72 6d 61 74 5f  sert_s_0_format_
1550: 74 31 2e 63 61 6c 6c 28 73 5f 30 29 0a 23 20 23  t1.call(s_0).# #
1560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
1570: 20 69 66 20 73 5f 30 3d 3d 22 30 22 0a 23 20 73   if s_0=="0".# s
1580: 5f 67 75 69 64 5f 67 65 6e 65 72 61 74 69 6f 6e  _guid_generation
1590: 5f 70 72 6f 67 72 61 6d 5f 6e 61 6d 65 3d 22 75  _program_name="u
15a0: 75 69 64 67 65 6e 22 0a 23 20 23 2d 2d 2d 2d 0a  uidgen".# #----.
15b0: 23 20 65 6c 73 65 0a 23 20 23 2d 2d 2d 2d 0a 23  # else.# #----.#
15c0: 20 73 5f 30 3d 28 60 77 68 69 63 68 20 75 75 69   s_0=(`which uui
15d0: 64 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20 31 3e  d 2>/dev/null 1>
15e0: 2f 64 65 76 2f 6e 75 6c 6c 3b 20 65 63 68 6f 20  /dev/null; echo 
15f0: 24 3f 60 29 2e 74 6f 5f 73 0a 23 20 73 5f 30 3d  $?`).to_s.# s_0=
1600: 73 5f 30 2e 67 73 75 62 28 2f 5b 5c 6e 5c 73 5c  s_0.gsub(/[\n\s\
1610: 72 5d 2f 2c 22 22 29 0a 23 20 66 75 6e 63 5f 61  r]/,"").# func_a
1620: 73 73 65 72 74 5f 73 5f 30 5f 66 6f 72 6d 61 74  ssert_s_0_format
1630: 5f 74 31 2e 63 61 6c 6c 28 73 5f 30 29 0a 23 20  _t1.call(s_0).# 
1640: 69 66 20 73 5f 30 3d 3d 22 30 22 0a 23 20 73 5f  if s_0=="0".# s_
1650: 67 75 69 64 5f 67 65 6e 65 72 61 74 69 6f 6e 5f  guid_generation_
1660: 70 72 6f 67 72 61 6d 5f 6e 61 6d 65 3d 22 75 75  program_name="uu
1670: 69 64 22 0a 23 20 65 6c 73 65 0a 23 20 73 5f 67  id".# else.# s_g
1680: 75 69 64 5f 32 3d 22 33 35 33 30 39 30 30 35 2d  uid_2="35309005-
1690: 62 66 32 30 2d 34 39 61 63 2d 62 32 37 66 2d 38  bf20-49ac-b27f-8
16a0: 30 32 30 37 30 65 30 33 31 65 37 22 0a 23 20 66  02070e031e7".# f
16b0: 75 6e 63 5f 74 68 72 6f 77 5f 74 31 2e 63 61 6c  unc_throw_t1.cal
16c0: 6c 28 73 5f 30 2c 73 5f 67 75 69 64 5f 32 29 0a  l(s_0,s_guid_2).
16d0: 23 20 65 6e 64 20 23 20 69 66 0a 23 20 23 2d 2d  # end # if.# #--
16e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 65 6e  -----------.# en
16f0: 64 20 23 20 69 66 0a 23 20 23 2d 2d 2d 2d 2d 2d  d # if.# #------
1700: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 23 20 41 20 74  --------.# # A t
1710: 65 73 74 20 74 6f 20 66 69 6e 64 20 6f 75 74 2c  est to find out,
1720: 20 77 68 65 74 68 65 72 20 74 68 65 20 47 55 49   whether the GUI
1730: 44 20 67 65 6e 65 72 61 74 69 6f 6e 20 70 72 6f  D generation pro
1740: 67 72 61 6d 0a 23 20 23 20 6f 6e 20 74 68 65 20  gram.# # on the 
1750: 50 41 54 48 20 65 78 69 74 73 20 77 69 74 68 20  PATH exits with 
1760: 61 6e 20 65 72 72 6f 72 20 63 6f 64 65 20 30 2e  an error code 0.
1770: 0a 23 20 73 5f 72 75 62 79 3d 22 73 5f 30 3d 28  .# s_ruby="s_0=(
1780: 60 22 2b 73 5f 67 75 69 64 5f 67 65 6e 65 72 61  `"+s_guid_genera
1790: 74 69 6f 6e 5f 70 72 6f 67 72 61 6d 5f 6e 61 6d  tion_program_nam
17a0: 65 2b 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20  e+" 2>/dev/null 
17b0: 31 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 65 63 68  1>/dev/null; ech
17c0: 6f 20 24 3f 60 29 2e 74 6f 5f 73 22 0a 23 20 65  o $?`).to_s".# e
17d0: 76 61 6c 28 73 5f 72 75 62 79 29 0a 23 20 73 5f  val(s_ruby).# s_
17e0: 30 3d 73 5f 30 2e 67 73 75 62 28 2f 5b 5c 6e 5c  0=s_0.gsub(/[\n\
17f0: 73 5c 72 5d 2f 2c 22 22 29 0a 23 20 66 75 6e 63  s\r]/,"").# func
1800: 5f 61 73 73 65 72 74 5f 73 5f 30 5f 66 6f 72 6d  _assert_s_0_form
1810: 61 74 5f 74 31 2e 63 61 6c 6c 28 73 5f 30 29 0a  at_t1.call(s_0).
1820: 23 20 69 66 20 73 5f 30 21 3d 22 30 22 0a 23 20  # if s_0!="0".# 
1830: 73 5f 67 75 69 64 5f 33 3d 22 37 37 61 65 33 36  s_guid_3="77ae36
1840: 36 33 2d 30 37 61 62 2d 34 65 37 34 2d 39 37 36  63-07ab-4e74-976
1850: 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 22 0a  f-802070e031e7".
1860: 23 20 66 75 6e 63 5f 74 68 72 6f 77 5f 74 31 2e  # func_throw_t1.
1870: 63 61 6c 6c 28 73 5f 30 2c 73 5f 67 75 69 64 5f  call(s_0,s_guid_
1880: 33 29 0a 23 20 65 6e 64 20 23 20 69 66 0a 23 20  3).# end # if.# 
1890: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  #--------------.
18a0: 23 20 73 5f 72 75 62 79 3d 22 73 5f 30 3d 28 60  # s_ruby="s_0=(`
18b0: 22 2b 73 5f 67 75 69 64 5f 67 65 6e 65 72 61 74  "+s_guid_generat
18c0: 69 6f 6e 5f 70 72 6f 67 72 61 6d 5f 6e 61 6d 65  ion_program_name
18d0: 2b 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 29  +" 2>/dev/null`)
18e0: 2e 74 6f 5f 73 22 0a 23 20 65 76 61 6c 28 73 5f  .to_s".# eval(s_
18f0: 72 75 62 79 29 0a 23 20 73 5f 30 3d 73 5f 30 2e  ruby).# s_0=s_0.
1900: 67 73 75 62 28 2f 5b 5c 6e 5c 73 5c 72 5d 2f 2c  gsub(/[\n\s\r]/,
1910: 22 22 29 0a 23 20 73 5f 73 63 72 69 70 74 5f 76  "").# s_script_v
1920: 65 72 73 69 6f 6e 3d 73 5f 30 0a 23 20 23 2d 2d  ersion=s_0.# #--
1930: 2d 2d 0a 23 20 69 66 20 73 5f 73 63 72 69 70 74  --.# if s_script
1940: 5f 76 65 72 73 69 6f 6e 2e 6c 65 6e 67 74 68 21  _version.length!
1950: 3d 33 36 0a 23 20 73 5f 67 75 69 64 5f 34 3d 22  =36.# s_guid_4="
1960: 61 32 34 64 32 65 33 63 2d 66 34 64 34 2d 34 39  a24d2e3c-f4d4-49
1970: 62 34 2d 39 35 36 66 2d 38 30 32 30 37 30 65 30  b4-956f-802070e0
1980: 33 31 65 37 22 0a 23 20 66 75 6e 63 5f 74 68 72  31e7".# func_thr
1990: 6f 77 5f 74 31 2e 63 61 6c 6c 28 73 5f 73 63 72  ow_t1.call(s_scr
19a0: 69 70 74 5f 76 65 72 73 69 6f 6e 2c 73 5f 67 75  ipt_version,s_gu
19b0: 69 64 5f 34 29 0a 23 20 65 6e 64 20 23 20 69 66  id_4).# end # if
19c0: 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .# #------------
19d0: 2d 2d 0a 23 20 73 3d 22 5c 6e 22 0a 23 20 73 3c  --.# s="\n".# s<
19e0: 3c 22 23 20 54 68 65 20 53 5f 53 43 52 49 50 54  <"# The S_SCRIPT
19f0: 5f 56 45 52 53 49 4f 4e 20 69 73 20 69 6e 20 32  _VERSION is in 2
1a00: 20 70 61 72 74 73 20 74 6f 20 61 6c 6c 6f 77 20   parts to allow 
1a10: 5c 6e 22 0a 23 20 73 3c 3c 22 23 20 74 68 65 20  \n".# s<<"# the 
1a20: 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 47 55  error message GU
1a30: 49 44 73 20 74 6f 20 62 65 20 75 70 64 61 74 65  IDs to be update
1a40: 64 20 77 69 74 68 6f 75 74 20 5c 6e 22 0a 23 20  d without \n".# 
1a50: 73 3c 3c 22 23 20 75 6e 73 79 6e 63 69 6e 67 20  s<<"# unsyncing 
1a60: 74 68 65 20 53 5f 53 43 52 49 50 54 5f 56 45 52  the S_SCRIPT_VER
1a70: 53 49 4f 4e 20 66 72 6f 6d 20 74 68 65 20 5c 6e  SION from the \n
1a80: 22 0a 23 20 73 3c 3c 22 23 20 53 5f 53 43 52 49  ".# s<<"# S_SCRI
1a90: 50 54 5f 56 45 52 53 49 4f 4e 5f 47 45 4e 45 52  PT_VERSION_GENER
1aa0: 41 54 49 4f 4e 5f 44 41 54 45 2e 5c 6e 22 0a 23  ATION_DATE.\n".#
1ab0: 20 69 5f 30 3d 31 32 0a 23 20 73 3c 3c 22 53 5f   i_0=12.# s<<"S_
1ac0: 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 53  SCRIPT_VERSION_S
1ad0: 55 42 50 41 52 54 5f 31 3d 5c 22 22 2b 73 5f 73  UBPART_1=\""+s_s
1ae0: 63 72 69 70 74 5f 76 65 72 73 69 6f 6e 5b 30 2e  cript_version[0.
1af0: 2e 69 5f 30 5d 2b 22 5c 22 5c 6e 22 0a 23 20 73  .i_0]+"\"\n".# s
1b00: 3c 3c 22 53 5f 53 43 52 49 50 54 5f 56 45 52 53  <<"S_SCRIPT_VERS
1b10: 49 4f 4e 5f 53 55 42 50 41 52 54 5f 32 3d 5c 22  ION_SUBPART_2=\"
1b20: 22 2b 73 5f 73 63 72 69 70 74 5f 76 65 72 73 69  "+s_script_versi
1b30: 6f 6e 5b 28 69 5f 30 2b 31 29 2e 2e 28 2d 31 29  on[(i_0+1)..(-1)
1b40: 5d 2b 22 5c 22 5c 6e 22 0a 23 20 73 3c 3c 22 53  ]+"\"\n".# s<<"S
1b50: 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 3d  _SCRIPT_VERSION=
1b60: 5c 22 24 53 5f 53 43 52 49 50 54 5f 56 45 52 53  \"$S_SCRIPT_VERS
1b70: 49 4f 4e 5f 53 55 42 50 41 52 54 5f 31 24 53 5f  ION_SUBPART_1$S_
1b80: 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 53  SCRIPT_VERSION_S
1b90: 55 42 50 41 52 54 5f 32 5c 22 22 0a 23 20 70 75  UBPART_2\"".# pu
1ba0: 74 73 28 73 29 0a 23 20 23 2d 2d 2d 2d 2d 2d 2d  ts(s).# #-------
1bb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1be0: 2d 2d 2d 0a 23 20 6f 62 5f 64 61 74 65 3d 54 69  ---.# ob_date=Ti
1bf0: 6d 65 2e 6e 65 77 0a 23 20 73 3d 22 22 0a 23 20  me.new.# s="".# 
1c00: 73 3c 3c 22 5c 6e 53 5f 53 43 52 49 50 54 5f 56  s<<"\nS_SCRIPT_V
1c10: 45 52 53 49 4f 4e 5f 47 45 4e 45 52 41 54 49 4f  ERSION_GENERATIO
1c20: 4e 5f 44 41 54 45 3d 5c 22 22 0a 23 20 73 3c 3c  N_DATE=\"".# s<<
1c30: 28 6f 62 5f 64 61 74 65 2e 79 65 61 72 2e 74 6f  (ob_date.year.to
1c40: 5f 73 2b 22 79 5f 22 29 0a 23 20 73 3c 3c 28 6f  _s+"y_").# s<<(o
1c50: 62 5f 64 61 74 65 2e 6d 6f 6e 74 68 2e 74 6f 5f  b_date.month.to_
1c60: 73 2b 22 6d 6f 6e 74 68 5f 22 29 0a 23 20 73 3c  s+"month_").# s<
1c70: 3c 28 6f 62 5f 64 61 74 65 2e 64 61 79 2e 74 6f  <(ob_date.day.to
1c80: 5f 73 2b 22 64 61 79 5f 22 29 0a 23 20 73 3c 3c  _s+"day_").# s<<
1c90: 28 6f 62 5f 64 61 74 65 2e 68 6f 75 72 2e 74 6f  (ob_date.hour.to
1ca0: 5f 73 2b 22 68 5f 22 29 0a 23 20 73 3c 3c 28 6f  _s+"h_").# s<<(o
1cb0: 62 5f 64 61 74 65 2e 6d 69 6e 2e 74 6f 5f 73 2b  b_date.min.to_s+
1cc0: 22 6d 69 6e 5f 22 29 0a 23 20 73 3c 3c 28 6f 62  "min_").# s<<(ob
1cd0: 5f 64 61 74 65 2e 73 65 63 2e 74 6f 5f 73 2b 22  _date.sec.to_s+"
1ce0: 73 65 63 5f 22 29 0a 23 20 73 3c 3c 28 6f 62 5f  sec_").# s<<(ob_
1cf0: 64 61 74 65 2e 75 73 65 63 2e 74 6f 5f 73 2b 22  date.usec.to_s+"
1d00: 75 73 65 63 22 29 0a 23 20 73 3c 3c 22 5c 22 5c  usec").# s<<"\"\
1d10: 6e 22 0a 23 20 70 75 74 73 28 73 29 0a 23 20 23  n".# puts(s).# #
1d20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 52 45 4e  ----------.# REN
1d60: 45 53 53 41 41 54 4f 52 5f 53 4f 55 52 43 45 5f  ESSAATOR_SOURCE_
1d70: 45 4e 44 0a 23 20 0a 23 20 52 45 4e 45 53 53 41  END.# .# RENESSA
1d80: 41 54 4f 52 5f 41 55 54 4f 47 45 4e 45 52 41 54  ATOR_AUTOGENERAT
1d90: 45 44 5f 54 45 58 54 5f 53 54 41 52 54 0a 0a 23  ED_TEXT_START..#
1da0: 20 54 68 65 20 53 5f 53 43 52 49 50 54 5f 56 45   The S_SCRIPT_VE
1db0: 52 53 49 4f 4e 20 69 73 20 69 6e 20 32 20 70 61  RSION is in 2 pa
1dc0: 72 74 73 20 74 6f 20 61 6c 6c 6f 77 20 0a 23 20  rts to allow .# 
1dd0: 74 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67  the error messag
1de0: 65 20 47 55 49 44 73 20 74 6f 20 62 65 20 75 70  e GUIDs to be up
1df0: 64 61 74 65 64 20 77 69 74 68 6f 75 74 20 0a 23  dated without .#
1e00: 20 75 6e 73 79 6e 63 69 6e 67 20 74 68 65 20 53   unsyncing the S
1e10: 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 20  _SCRIPT_VERSION 
1e20: 66 72 6f 6d 20 74 68 65 20 0a 23 20 53 5f 53 43  from the .# S_SC
1e30: 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 47 45 4e  RIPT_VERSION_GEN
1e40: 45 52 41 54 49 4f 4e 5f 44 41 54 45 2e 0a 53 5f  ERATION_DATE..S_
1e50: 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 53  SCRIPT_VERSION_S
1e60: 55 42 50 41 52 54 5f 31 3d 22 63 64 35 36 65 36  UBPART_1="cd56e6
1e70: 31 30 2d 63 63 35 32 22 0a 53 5f 53 43 52 49 50  10-cc52".S_SCRIP
1e80: 54 5f 56 45 52 53 49 4f 4e 5f 53 55 42 50 41 52  T_VERSION_SUBPAR
1e90: 54 5f 32 3d 22 2d 34 37 37 36 2d 62 30 32 34 2d  T_2="-4776-b024-
1ea0: 39 65 63 33 38 32 61 66 37 31 64 34 22 0a 53 5f  9ec382af71d4".S_
1eb0: 53 43 52 49 50 54 5f 56 45 52 53 49 4f 4e 3d 22  SCRIPT_VERSION="
1ec0: 24 53 5f 53 43 52 49 50 54 5f 56 45 52 53 49 4f  $S_SCRIPT_VERSIO
1ed0: 4e 5f 53 55 42 50 41 52 54 5f 31 24 53 5f 53 43  N_SUBPART_1$S_SC
1ee0: 52 49 50 54 5f 56 45 52 53 49 4f 4e 5f 53 55 42  RIPT_VERSION_SUB
1ef0: 50 41 52 54 5f 32 22 0a 0a 53 5f 53 43 52 49 50  PART_2"..S_SCRIP
1f00: 54 5f 56 45 52 53 49 4f 4e 5f 47 45 4e 45 52 41  T_VERSION_GENERA
1f10: 54 49 4f 4e 5f 44 41 54 45 3d 22 32 30 31 37 79  TION_DATE="2017y
1f20: 5f 33 6d 6f 6e 74 68 5f 31 34 64 61 79 5f 37 68  _3month_14day_7h
1f30: 5f 32 6d 69 6e 5f 34 73 65 63 5f 35 34 37 32 33  _2min_4sec_54723
1f40: 31 75 73 65 63 22 0a 0a 23 20 52 45 4e 45 53 53  1usec"..# RENESS
1f50: 41 41 54 4f 52 5f 41 55 54 4f 47 45 4e 45 52 41  AATOR_AUTOGENERA
1f60: 54 45 44 5f 54 45 58 54 5f 45 4e 44 0a 23 20 52  TED_TEXT_END.# R
1f70: 45 4e 45 53 53 41 41 54 4f 52 5f 42 4c 4f 43 4b  ENESSAATOR_BLOCK
1f80: 5f 45 4e 44 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  _END..#---------
1f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fd0: 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 65 78 69  -..func_mmmv_exi
1fe0: 74 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f 70 61 74 68  t_if_not_on_path
1ff0: 5f 74 32 28 29 20 7b 20 23 20 53 5f 43 4f 4d 4d  _t2() { # S_COMM
2000: 41 4e 44 5f 4e 41 4d 45 0a 20 20 20 20 6c 6f 63  AND_NAME.    loc
2010: 61 6c 20 53 5f 43 4f 4d 4d 41 4e 44 5f 4e 41 4d  al S_COMMAND_NAM
2020: 45 3d 24 31 0a 20 20 20 20 6c 6f 63 61 6c 20 53  E=$1.    local S
2030: 5f 4c 4f 43 41 4c 5f 56 41 52 49 41 42 4c 45 3d  _LOCAL_VARIABLE=
2040: 22 60 77 68 69 63 68 20 24 53 5f 43 4f 4d 4d 41  "`which $S_COMMA
2050: 4e 44 5f 4e 41 4d 45 20 32 3e 2f 64 65 76 2f 6e  ND_NAME 2>/dev/n
2060: 75 6c 6c 60 22 0a 20 20 20 20 69 66 20 5b 20 22  ull`".    if [ "
2070: 24 53 5f 4c 4f 43 41 4c 5f 56 41 52 49 41 42 4c  $S_LOCAL_VARIABL
2080: 45 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e  E" == "" ]; then
2090: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
20a0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 43  .        echo "C
20b0: 6f 6d 6d 61 6e 64 20 5c 22 24 53 5f 43 4f 4d 4d  ommand \"$S_COMM
20c0: 41 4e 44 5f 4e 41 4d 45 5c 22 20 63 6f 75 6c 64  AND_NAME\" could
20d0: 20 6e 6f 74 20 62 65 20 66 6f 75 6e 64 20 66 72   not be found fr
20e0: 6f 6d 20 74 68 65 20 50 41 54 48 2e 20 22 0a 20  om the PATH. ". 
20f0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
2100: 20 65 78 65 63 75 74 69 6f 6e 20 6f 66 20 74 68   execution of th
2110: 65 20 42 61 73 68 20 73 63 72 69 70 74 20 69 73  e Bash script is
2120: 20 61 62 6f 72 74 65 64 2e 22 0a 20 20 20 20 20   aborted.".     
2130: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
2140: 31 61 62 39 65 64 34 31 2d 30 64 36 39 2d 34 61  1ab9ed41-0d69-4a
2150: 61 35 2d 62 37 37 66 2d 38 30 32 30 37 30 65 30  a5-b77f-802070e0
2160: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
2170: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
2180: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
2190: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
21a0: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
21b0: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
21c0: 66 69 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  fi.} # func_mmmv
21d0: 5f 65 78 69 74 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f  _exit_if_not_on_
21e0: 70 61 74 68 5f 74 32 0a 0a 0a 23 20 41 20 6c 69  path_t2...# A li
21f0: 73 74 20 6f 66 20 74 68 65 20 63 6f 6e 73 6f 6c  st of the consol
2200: 65 20 74 6f 6f 6c 73 20 74 68 61 74 20 74 68 65  e tools that the
2210: 20 72 65 73 74 20 6f 66 20 74 68 65 20 0a 23 20   rest of the .# 
2220: 76 65 72 69 66 69 63 61 74 69 6f 6e 20 66 75 6e  verification fun
2230: 63 74 69 6f 6e 73 20 69 6e 20 74 68 69 73 20 42  ctions in this B
2240: 61 73 68 20 73 63 72 69 70 74 20 64 65 70 65 6e  ash script depen
2250: 64 20 6f 6e 2e 0a 23 20 54 68 65 20 70 72 65 73  d on..# The pres
2260: 65 6e 63 65 20 6f 66 20 74 68 65 20 72 65 73 74  ence of the rest
2270: 20 6f 66 20 74 68 65 20 63 6f 6e 73 6f 6c 65 20   of the console 
2280: 61 70 70 6c 69 63 61 74 69 6f 6e 73 0a 23 20 61  applications.# a
2290: 72 65 20 73 74 75 64 69 65 64 20 62 79 20 74 68  re studied by th
22a0: 65 20 6f 74 68 65 72 20 76 65 72 69 66 69 63 61  e other verifica
22b0: 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 73 2e 20  tion functions. 
22c0: 0a 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  ..    func_mmmv_
22d0: 65 78 69 74 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f 70  exit_if_not_on_p
22e0: 61 74 68 5f 74 32 20 22 67 72 65 70 22 0a 20 20  ath_t2 "grep".  
22f0: 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 65 78 69 74    func_mmmv_exit
2300: 5f 69 66 5f 6e 6f 74 5f 6f 6e 5f 70 61 74 68 5f  _if_not_on_path_
2310: 74 32 20 22 72 75 62 79 22 0a 20 20 20 20 66 75  t2 "ruby".    fu
2320: 6e 63 5f 6d 6d 6d 76 5f 65 78 69 74 5f 69 66 5f  nc_mmmv_exit_if_
2330: 6e 6f 74 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22  not_on_path_t2 "
2340: 75 6e 61 6d 65 22 0a 20 20 20 20 66 75 6e 63 5f  uname".    func_
2350: 6d 6d 6d 76 5f 65 78 69 74 5f 69 66 5f 6e 6f 74  mmmv_exit_if_not
2360: 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 77 68 69  _on_path_t2 "whi
2370: 63 68 22 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ch"..#----------
2380: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2390: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23c0: 0a 0a 23 20 53 42 5f 55 53 45 5f 47 41 57 4b 5f  ..# SB_USE_GAWK_
23d0: 49 4e 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b 3d  IN_STEAD_OF_AWK=
23e0: 22 6e 6f 74 5f 73 65 74 5f 79 65 74 22 0a 23 20  "not_set_yet".# 
23f0: 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
2400: 72 72 65 6e 74 5f 69 6e 69 74 5f 61 77 6b 5f 76  rrent_init_awk_v
2410: 65 72 73 75 73 5f 67 61 77 6b 28 29 20 7b 20 0a  ersus_gawk() { .
2420: 23 20 20 20 20 20 6c 6f 63 61 6c 20 53 42 5f 41  #     local SB_A
2430: 57 4b 5f 41 4e 44 5f 47 41 57 4b 5f 41 52 45 5f  WK_AND_GAWK_ARE_
2440: 42 4f 54 48 5f 55 4e 55 53 41 42 4c 45 3d 22 66  BOTH_UNUSABLE="f
2450: 22 0a 23 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ".#     #-------
2460: 2d 0a 23 20 20 20 20 20 6c 6f 63 61 6c 20 53 5f  -.#     local S_
2470: 54 4d 50 5f 30 3d 22 60 77 68 69 63 68 20 67 61  TMP_0="`which ga
2480: 77 6b 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22  wk 2>/dev/null`"
2490: 0a 23 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f  .#     if [ "$S_
24a0: 54 4d 50 5f 30 22 20 3d 3d 20 22 22 20 5d 3b 20  TMP_0" == "" ]; 
24b0: 74 68 65 6e 0a 23 20 20 20 20 20 20 20 20 20 53  then.#         S
24c0: 5f 54 4d 50 5f 30 3d 22 60 77 68 69 63 68 20 61  _TMP_0="`which a
24d0: 77 6b 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22  wk 2>/dev/null`"
24e0: 0a 23 20 20 20 20 20 20 20 20 20 69 66 20 5b 20  .#         if [ 
24f0: 22 24 53 5f 54 4d 50 5f 30 22 20 3d 3d 20 22 22  "$S_TMP_0" == ""
2500: 20 5d 3b 20 74 68 65 6e 0a 23 20 20 20 20 20 20   ]; then.#      
2510: 20 20 20 20 20 20 20 53 42 5f 41 57 4b 5f 41 4e         SB_AWK_AN
2520: 44 5f 47 41 57 4b 5f 41 52 45 5f 42 4f 54 48 5f  D_GAWK_ARE_BOTH_
2530: 55 4e 55 53 41 42 4c 45 3d 22 74 22 0a 23 20 20  UNUSABLE="t".#  
2540: 20 20 20 20 20 20 20 65 6c 73 65 0a 23 20 20 20         else.#   
2550: 20 20 20 20 20 20 20 20 20 20 53 42 5f 55 53 45            SB_USE
2560: 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41 44 5f 4f  _GAWK_IN_STEAD_O
2570: 46 5f 41 57 4b 3d 22 66 22 0a 23 20 20 20 20 20  F_AWK="f".#     
2580: 20 20 20 20 66 69 0a 23 20 20 20 20 20 65 6c 73      fi.#     els
2590: 65 0a 23 20 20 20 20 20 20 20 20 20 53 42 5f 55  e.#         SB_U
25a0: 53 45 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41 44  SE_GAWK_IN_STEAD
25b0: 5f 4f 46 5f 41 57 4b 3d 22 74 22 0a 23 20 20 20  _OF_AWK="t".#   
25c0: 20 20 66 69 0a 23 20 20 20 20 20 23 2d 2d 2d 2d    fi.#     #----
25d0: 2d 2d 2d 2d 0a 23 20 20 20 20 20 69 66 20 5b 20  ----.#     if [ 
25e0: 22 24 53 42 5f 41 57 4b 5f 41 4e 44 5f 47 41 57  "$SB_AWK_AND_GAW
25f0: 4b 5f 41 52 45 5f 42 4f 54 48 5f 55 4e 55 53 41  K_ARE_BOTH_UNUSA
2600: 42 4c 45 22 20 3d 3d 20 22 74 22 20 5d 3b 20 74  BLE" == "t" ]; t
2610: 68 65 6e 0a 23 20 20 20 20 20 20 20 20 20 65 63  hen.#         ec
2620: 68 6f 20 22 22 0a 23 20 20 20 20 20 20 20 20 20  ho "".#         
2630: 65 63 68 6f 20 22 4e 65 69 74 68 65 72 20 5c 22  echo "Neither \"
2640: 61 77 6b 5c 22 2c 20 6e 6f 72 20 5c 22 67 61 77  awk\", nor \"gaw
2650: 6b 5c 22 20 69 73 20 75 73 61 62 6c 65 2c 22 0a  k\" is usable,".
2660: 23 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  #         echo "
2670: 62 75 74 20 61 74 20 6c 65 61 73 74 20 6f 6e 65  but at least one
2680: 20 6f 66 20 74 68 65 6d 20 69 73 20 72 65 71 75   of them is requ
2690: 69 72 65 64 20 74 6f 20 62 65 20 75 73 61 62 6c  ired to be usabl
26a0: 65 2e 22 0a 23 20 20 20 20 20 20 20 20 20 65 63  e.".#         ec
26b0: 68 6f 20 22 54 68 65 20 65 78 65 63 75 74 69 6f  ho "The executio
26c0: 6e 20 6f 66 20 74 68 65 20 42 61 73 68 20 73 63  n of the Bash sc
26d0: 72 69 70 74 20 69 73 20 61 62 6f 72 74 65 64 2e  ript is aborted.
26e0: 22 0a 23 20 20 20 20 20 20 20 20 20 65 63 68 6f  ".#         echo
26f0: 20 22 47 55 49 44 3d 3d 27 39 37 39 61 36 34 32   "GUID=='979a642
2700: 62 2d 36 62 39 33 2d 34 33 36 63 2d 61 34 37 66  b-6b93-436c-a47f
2710: 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
2720: 23 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  #         echo "
2730: 22 0a 23 20 20 20 20 20 20 20 20 20 23 2d 2d 2d  ".#         #---
2740: 2d 0a 23 20 20 20 20 20 20 20 20 20 63 64 20 24  -.#         cd $
2750: 53 5f 46 50 5f 4f 52 49 47 0a 23 20 20 20 20 20  S_FP_ORIG.#     
2760: 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
2770: 74 20 77 69 74 68 20 65 72 72 6f 72 0a 23 20 20  t with error.#  
2780: 20 20 20 66 69 0a 23 20 7d 20 23 20 66 75 6e 63     fi.# } # func
2790: 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
27a0: 74 5f 69 6e 69 74 5f 61 77 6b 5f 76 65 72 73 75  t_init_awk_versu
27b0: 73 5f 67 61 77 6b 0a 23 20 0a 23 20 66 75 6e 63  s_gawk.# .# func
27c0: 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
27d0: 74 5f 69 6e 69 74 5f 61 77 6b 5f 76 65 72 73 75  t_init_awk_versu
27e0: 73 5f 67 61 77 6b 0a 23 20 0a 23 20 69 66 20 5b  s_gawk.# .# if [
27f0: 20 22 24 53 42 5f 55 53 45 5f 47 41 57 4b 5f 49   "$SB_USE_GAWK_I
2800: 4e 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b 22 20  N_STEAD_OF_AWK" 
2810: 21 3d 20 22 74 22 20 5d 3b 20 74 68 65 6e 0a 23  != "t" ]; then.#
2820: 20 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 55       if [ "$SB_U
2830: 53 45 5f 47 41 57 4b 5f 49 4e 5f 53 54 45 41 44  SE_GAWK_IN_STEAD
2840: 5f 4f 46 5f 41 57 4b 22 20 21 3d 20 22 66 22 20  _OF_AWK" != "f" 
2850: 5d 3b 20 74 68 65 6e 0a 23 20 20 20 20 20 20 20  ]; then.#       
2860: 20 20 65 63 68 6f 20 22 22 0a 23 20 20 20 20 20    echo "".#     
2870: 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 73      echo "This s
2880: 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e  cript is flawed.
2890: 22 0a 23 20 20 20 20 20 20 20 20 20 65 63 68 6f  ".#         echo
28a0: 20 22 22 0a 23 20 20 20 20 20 20 20 20 20 65 63   "".#         ec
28b0: 68 6f 20 22 20 20 20 20 53 42 5f 55 53 45 5f 47  ho "    SB_USE_G
28c0: 41 57 4b 5f 49 4e 5f 53 54 45 41 44 5f 4f 46 5f  AWK_IN_STEAD_OF_
28d0: 41 57 4b 3d 24 53 42 5f 55 53 45 5f 47 41 57 4b  AWK=$SB_USE_GAWK
28e0: 5f 49 4e 5f 53 54 45 41 44 5f 4f 46 5f 41 57 4b  _IN_STEAD_OF_AWK
28f0: 22 0a 23 20 20 20 20 20 20 20 20 20 65 63 68 6f  ".#         echo
2900: 20 22 22 0a 23 20 20 20 20 20 20 20 20 20 65 63   "".#         ec
2910: 68 6f 20 22 47 55 49 44 3d 3d 27 33 37 35 65 39  ho "GUID=='375e9
2920: 33 34 30 2d 36 30 31 31 2d 34 35 36 31 2d 39 32  340-6011-4561-92
2930: 37 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  7f-802070e031e7'
2940: 22 0a 23 20 20 20 20 20 20 20 20 20 65 63 68 6f  ".#         echo
2950: 20 22 22 0a 23 20 20 20 20 20 20 20 20 20 23 2d   "".#         #-
2960: 2d 2d 2d 0a 23 20 20 20 20 20 20 20 20 20 63 64  ---.#         cd
2970: 20 24 53 5f 46 50 5f 4f 52 49 47 0a 23 20 20 20   $S_FP_ORIG.#   
2980: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
2990: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 23  xit with error.#
29a0: 20 20 20 20 20 66 69 0a 23 20 66 69 0a 0a 23 2d       fi.# fi..#-
29b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
29c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
29d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
29e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
29f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e  ---------..S_FUN
2a00: 43 5f 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e 47  C_MMMV_OPERATING
2a10: 5f 53 59 53 54 45 4d 5f 54 59 50 45 5f 54 31 5f  _SYSTEM_TYPE_T1_
2a20: 52 45 53 55 4c 54 3d 22 22 0a 66 75 6e 63 5f 6d  RESULT="".func_m
2a30: 6d 6d 76 5f 6f 70 65 72 61 74 69 6e 67 5f 73 79  mmv_operating_sy
2a40: 73 74 65 6d 5f 74 79 70 65 5f 74 31 28 29 20 7b  stem_type_t1() {
2a50: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
2a60: 4e 43 5f 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e  NC_MMMV_OPERATIN
2a70: 47 5f 53 59 53 54 45 4d 5f 54 59 50 45 5f 54 31  G_SYSTEM_TYPE_T1
2a80: 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 22 20 5d  _RESULT" == "" ]
2a90: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
2aa0: 5f 54 4d 50 5f 30 3d 22 60 75 6e 61 6d 65 20 2d  _TMP_0="`uname -
2ab0: 61 20 7c 20 67 72 65 70 20 2d 45 20 5b 4c 6c 5d  a | grep -E [Ll]
2ac0: 69 6e 75 78 60 22 0a 20 20 20 20 20 20 20 20 69  inux`".        i
2ad0: 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 21  f [ "$S_TMP_0" !
2ae0: 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  = "" ]; then.   
2af0: 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f           S_FUNC_
2b00: 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e 47 5f 53  MMMV_OPERATING_S
2b10: 59 53 54 45 4d 5f 54 59 50 45 5f 54 31 5f 52 45  YSTEM_TYPE_T1_RE
2b20: 53 55 4c 54 3d 22 4c 69 6e 75 78 22 0a 20 20 20  SULT="Linux".   
2b30: 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20       else.      
2b40: 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60        S_TMP_0="`
2b50: 75 6e 61 6d 65 20 2d 61 20 7c 20 67 72 65 70 20  uname -a | grep 
2b60: 42 53 44 20 60 22 0a 20 20 20 20 20 20 20 20 20  BSD `".         
2b70: 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f     if [ "$S_TMP_
2b80: 30 22 20 21 3d 20 22 22 20 5d 3b 20 74 68 65 6e  0" != "" ]; then
2b90: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
2ba0: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 4f 50 45   S_FUNC_MMMV_OPE
2bb0: 52 41 54 49 4e 47 5f 53 59 53 54 45 4d 5f 54 59  RATING_SYSTEM_TY
2bc0: 50 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 42 53  PE_T1_RESULT="BS
2bd0: 44 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  D".            e
2be0: 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20  lse.            
2bf0: 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f      S_FUNC_MMMV_
2c00: 4f 50 45 52 41 54 49 4e 47 5f 53 59 53 54 45 4d  OPERATING_SYSTEM
2c10: 5f 54 59 50 45 5f 54 31 5f 52 45 53 55 4c 54 3d  _TYPE_T1_RESULT=
2c20: 22 75 6e 64 65 74 65 72 6d 69 6e 65 64 22 0a 20  "undetermined". 
2c30: 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20 20             fi.  
2c40: 20 20 20 20 20 20 66 69 0a 20 20 20 20 66 69 0a        fi.    fi.
2c50: 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 6f 70  } # func_mmmv_op
2c60: 65 72 61 74 69 6e 67 5f 73 79 73 74 65 6d 5f 74  erating_system_t
2c70: 79 70 65 5f 74 31 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  ype_t1..#-------
2c80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ca0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2cb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2cc0: 2d 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 6f  ---..func_mmmv_o
2cd0: 70 65 72 61 74 69 6e 67 5f 73 79 73 74 65 6d 5f  perating_system_
2ce0: 74 79 70 65 5f 74 31 0a 69 66 20 5b 20 22 24 53  type_t1.if [ "$S
2cf0: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 4f 50 45 52 41  _FUNC_MMMV_OPERA
2d00: 54 49 4e 47 5f 53 59 53 54 45 4d 5f 54 59 50 45  TING_SYSTEM_TYPE
2d10: 5f 54 31 5f 52 45 53 55 4c 54 22 20 21 3d 20 22  _T1_RESULT" != "
2d20: 4c 69 6e 75 78 22 20 5d 3b 20 74 68 65 6e 0a 20  Linux" ]; then. 
2d30: 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43     if [ "$S_FUNC
2d40: 5f 4d 4d 4d 56 5f 4f 50 45 52 41 54 49 4e 47 5f  _MMMV_OPERATING_
2d50: 53 59 53 54 45 4d 5f 54 59 50 45 5f 54 31 5f 52  SYSTEM_TYPE_T1_R
2d60: 45 53 55 4c 54 22 20 21 3d 20 22 42 53 44 22 20  ESULT" != "BSD" 
2d70: 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
2d80: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
2d90: 65 63 68 6f 20 22 20 20 54 68 65 20 63 6c 61 73  echo "  The clas
2da0: 73 69 63 61 6c 20 63 6f 6d 6d 61 6e 64 20 6c 69  sical command li
2db0: 6e 65 20 75 74 69 6c 69 74 69 65 73 20 61 74 20  ne utilities at 
2dc0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
2dd0: 20 20 64 69 66 66 65 72 65 6e 74 20 6f 70 65 72    different oper
2de0: 61 74 69 6e 67 20 73 79 73 74 65 6d 73 2c 20 66  ating systems, f
2df0: 6f 72 20 65 78 61 6d 70 6c 65 2c 20 4c 69 6e 75  or example, Linu
2e00: 78 20 61 6e 64 20 42 53 44 2c 22 0a 20 20 20 20  x and BSD,".    
2e10: 20 20 20 20 65 63 68 6f 20 22 20 20 64 69 66 66      echo "  diff
2e20: 65 72 2e 20 54 68 69 73 20 73 63 72 69 70 74 20  er. This script 
2e30: 69 73 20 64 65 73 69 67 6e 65 64 20 74 6f 20 72  is designed to r
2e40: 75 6e 20 6f 6e 6c 79 20 6f 6e 20 22 0a 20 20 20  un only on ".   
2e50: 20 20 20 20 20 65 63 68 6f 20 22 20 20 4c 69 6e       echo "  Lin
2e60: 75 78 20 61 6e 64 20 73 6f 6d 65 20 42 53 44 20  ux and some BSD 
2e70: 76 61 72 69 61 6e 74 73 2e 22 0a 20 20 20 20 20  variants.".     
2e80: 20 20 20 65 63 68 6f 20 22 20 20 49 66 20 59 6f     echo "  If Yo
2e90: 75 20 61 72 65 20 77 69 6c 6c 69 6e 67 20 74 6f  u are willing to
2ea0: 20 72 69 73 6b 20 74 68 61 74 20 73 6f 6d 65 20   risk that some 
2eb0: 6f 66 20 59 6f 75 72 20 64 61 74 61 20 22 0a 20  of Your data ". 
2ec0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 69         echo "  i
2ed0: 73 20 64 65 6c 65 74 65 64 20 61 6e 64 2f 6f 72  s deleted and/or
2ee0: 20 59 6f 75 72 20 6f 70 65 72 61 74 69 6e 67 20   Your operating 
2ef0: 73 79 73 74 65 6d 20 69 6e 73 74 61 6e 63 65 22  system instance"
2f00: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
2f10: 20 62 65 63 6f 6d 65 73 20 70 65 72 6d 61 6e 65   becomes permane
2f20: 6e 74 6c 79 20 66 6c 61 77 65 64 2c 20 74 6f 20  ntly flawed, to 
2f30: 74 68 65 20 70 6f 69 6e 74 20 74 68 61 74 20 22  the point that "
2f40: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
2f50: 20 69 74 20 77 69 6c 6c 20 6e 6f 74 20 65 76 65   it will not eve
2f60: 6e 20 62 6f 6f 74 2c 20 74 68 65 6e 20 59 6f 75  n boot, then You
2f70: 20 6d 61 79 20 65 64 69 74 20 74 68 65 20 42 61   may edit the Ba
2f80: 73 68 20 73 63 72 69 70 74 20 74 68 61 74 20 22  sh script that "
2f90: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
2fa0: 20 64 69 73 70 6c 61 79 73 20 74 68 69 73 20 65   displays this e
2fb0: 72 72 6f 72 20 6d 65 73 73 61 67 65 20 62 79 20  rror message by 
2fc0: 6d 6f 64 69 66 79 69 6e 67 20 74 68 65 20 74 65  modifying the te
2fd0: 73 74 20 74 68 61 74 20 22 0a 20 20 20 20 20 20  st that ".      
2fe0: 20 20 65 63 68 6f 20 22 20 20 63 68 65 63 6b 73    echo "  checks
2ff0: 20 66 6f 72 20 74 68 65 20 6f 70 65 72 61 74 69   for the operati
3000: 6e 67 20 73 79 73 74 65 6d 20 74 79 70 65 2e 22  ng system type."
3010: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
3020: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
3030: 20 49 66 20 59 6f 75 20 64 6f 20 64 65 63 69 64   If You do decid
3040: 65 20 74 6f 20 65 64 69 74 20 74 68 69 73 20 42  e to edit this B
3050: 61 73 68 20 73 63 72 69 70 74 2c 20 74 68 65 6e  ash script, then
3060: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
3070: 22 20 20 61 20 72 65 63 6f 6d 6d 65 6e 64 61 74  "  a recommendat
3080: 69 6f 6e 20 69 73 20 74 6f 20 74 65 73 74 20 59  ion is to test Y
3090: 6f 75 72 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e  our modification
30a0: 73 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  s ".        echo
30b0: 20 22 20 20 77 69 74 68 69 6e 20 61 20 76 69 72   "  within a vir
30c0: 74 75 61 6c 20 6d 61 63 68 69 6e 65 20 6f 72 2c  tual machine or,
30d0: 20 69 66 20 76 69 72 74 75 61 6c 20 6d 61 63 68   if virtual mach
30e0: 69 6e 65 73 20 61 72 65 20 6e 6f 74 22 0a 20 20  ines are not".  
30f0: 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 61 6e        echo "  an
3100: 20 6f 70 74 69 6f 6e 2c 20 61 73 20 73 6f 6d 65   option, as some
3110: 20 6e 65 77 20 6f 70 65 72 61 74 69 6e 67 20 73   new operating s
3120: 79 73 74 65 6d 20 75 73 65 72 20 74 68 61 74 20  ystem user that 
3130: 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 22 0a  does not have ".
3140: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
3150: 61 6e 79 20 61 63 63 65 73 73 20 74 6f 20 74 68  any access to th
3160: 65 20 76 69 74 61 6c 20 64 61 74 61 2f 66 69 6c  e vital data/fil
3170: 65 73 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  es.".        ech
3180: 6f 20 22 20 20 47 55 49 44 3d 3d 27 30 65 32 61  o "  GUID=='0e2a
3190: 64 34 34 30 2d 37 61 32 62 2d 34 32 61 37 2d 61  d440-7a2b-42a7-a
31a0: 32 37 66 2d 38 30 32 30 37 30 65 30 33 31 65 37  27f-802070e031e7
31b0: 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
31c0: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
31d0: 22 20 20 41 62 6f 72 74 69 6e 67 20 73 63 72 69  "  Aborting scri
31e0: 70 74 20 77 69 74 68 6f 75 74 20 64 6f 69 6e 67  pt without doing
31f0: 20 61 6e 79 74 68 69 6e 67 2e 22 0a 20 20 20 20   anything.".    
3200: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
3210: 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
3220: 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
3230: 20 66 69 0a 66 69 0a 0a 0a 23 2d 2d 2d 2d 2d 2d   fi.fi...#------
3240: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3280: 2d 2d 2d 2d 0a 0a 0a 53 42 5f 45 58 49 53 54 53  ----...SB_EXISTS
3290: 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55  _ON_PATH_T1_RESU
32a0: 4c 54 3d 22 66 22 0a 66 75 6e 63 5f 73 62 5f 65  LT="f".func_sb_e
32b0: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31  xists_on_path_t1
32c0: 20 28 29 20 7b 0a 20 20 20 20 6c 6f 63 61 6c 20   () {.    local 
32d0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
32e0: 45 43 55 54 41 42 4c 45 5f 31 3d 22 24 31 22 20  ECUTABLE_1="$1" 
32f0: 23 20 66 69 72 73 74 20 66 75 6e 63 74 69 6f 6e  # first function
3300: 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 23 2d   argument.    #-
3310: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61  -------.    loca
3320: 6c 20 53 5f 54 4d 50 5f 30 3d 22 22 20 23 20 64  l S_TMP_0="" # d
3330: 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 6c  eclaration.    l
3340: 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22 22 20  ocal S_TMP_1="" 
3350: 23 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20  # declaration.  
3360: 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 32 3d    local S_TMP_2=
3370: 22 22 20 23 20 64 65 63 6c 61 72 61 74 69 6f 6e  "" # declaration
3380: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  .    #--------. 
3390: 20 20 20 23 20 46 75 6e 63 74 69 6f 6e 20 63 61     # Function ca
33a0: 6c 6c 73 20 6c 69 6b 65 0a 20 20 20 20 23 0a 20  lls like.    #. 
33b0: 20 20 20 23 20 20 20 20 20 66 75 6e 63 5f 73 62     #     func_sb
33c0: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
33d0: 74 31 20 22 22 0a 20 20 20 20 23 20 20 20 20 20  t1 "".    #     
33e0: 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f  func_sb_exists_o
33f0: 6e 5f 70 61 74 68 5f 74 31 20 22 20 22 0a 20 20  n_path_t1 " ".  
3400: 20 20 23 20 20 20 20 20 66 75 6e 63 5f 73 62 5f    #     func_sb_
3410: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
3420: 31 20 22 6c 73 20 70 73 22 20 23 20 63 6f 6e 74  1 "ls ps" # cont
3430: 61 69 6e 73 20 61 20 73 70 61 63 65 0a 20 20 20  ains a space.   
3440: 20 23 0a 20 20 20 20 23 20 61 72 65 20 6e 6f 74   #.    # are not
3450: 20 61 6c 6c 6f 77 65 64 2e 0a 20 20 20 20 69 66   allowed..    if
3460: 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54   [ "$S_NAME_OF_T
3470: 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 22  HE_EXECUTABLE_1"
3480: 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
3490: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
34a0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
34b0: 65 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 20  e Bash function 
34c0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
34d0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
34e0: 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78 69 73      func_sb_exis
34f0: 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22 0a  ts_on_path_t1 ".
3500: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
3510: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 69 73          echo "is
3520: 20 6e 6f 74 20 64 65 73 69 67 6e 65 64 20 74 6f   not designed to
3530: 20 68 61 6e 64 6c 65 20 61 6e 20 61 72 67 75 6d   handle an argum
3540: 65 6e 74 20 74 68 61 74 20 22 0a 20 20 20 20 20  ent that ".     
3550: 20 20 20 65 63 68 6f 20 22 65 71 75 61 6c 73 20     echo "equals 
3560: 77 69 74 68 20 61 6e 20 65 6d 70 74 79 20 73 74  with an empty st
3570: 72 69 6e 67 2e 22 0a 20 20 20 20 20 20 20 20 65  ring.".        e
3580: 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 31 39 62  cho "GUID=='419b
3590: 31 37 38 36 2d 64 66 39 65 2d 34 66 35 30 2d 38  1786-df9e-4f50-8
35a0: 35 36 66 2d 38 30 32 30 37 30 65 30 33 31 65 37  56f-802070e031e7
35b0: 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
35c0: 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
35d0: 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
35e0: 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
35f0: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
3600: 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
3610: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62     S_TMP_0="`rub
3620: 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53  y -e \"print('$S
3630: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
3640: 43 55 54 41 42 4c 45 5f 31 27 2e 74 6f 5f 73 2e  CUTABLE_1'.to_s.
3650: 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29  gsub(/[\s]+/,'')
3660: 29 3b 5c 22 20 60 22 0a 20 20 20 20 69 66 20 5b  );\" `".    if [
3670: 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45   "$S_NAME_OF_THE
3680: 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 22 20 21  _EXECUTABLE_1" !
3690: 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 20 3b  = "$S_TMP_0" ] ;
36a0: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
36b0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
36c0: 68 6f 20 22 54 68 65 20 42 61 73 68 20 66 75 6e  ho "The Bash fun
36d0: 63 74 69 6f 6e 20 22 0a 20 20 20 20 20 20 20 20  ction ".        
36e0: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
36f0: 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63 5f 73  echo "    func_s
3700: 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  b_exists_on_path
3710: 5f 74 31 20 22 0a 20 20 20 20 20 20 20 20 65 63  _t1 ".        ec
3720: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
3730: 68 6f 20 22 69 73 20 6e 6f 74 20 64 65 73 69 67  ho "is not desig
3740: 6e 65 64 20 74 6f 20 68 61 6e 64 6c 65 20 61 6e  ned to handle an
3750: 20 61 72 67 75 6d 65 6e 74 20 76 61 6c 75 65 20   argument value 
3760: 74 68 61 74 20 63 6f 6e 74 61 69 6e 73 20 22 0a  that contains ".
3770: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 73 70          echo "sp
3780: 61 63 65 73 20 6f 72 20 74 61 62 75 6c 61 74 69  aces or tabulati
3790: 6f 6e 20 63 68 61 72 61 63 74 65 72 73 2e 22 0a  on characters.".
37a0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
37b0: 65 20 72 65 63 65 69 76 65 64 20 76 61 6c 75 65  e received value
37c0: 20 69 6e 20 70 61 72 65 6e 74 68 65 73 69 73 3a   in parenthesis:
37d0: 28 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  ($S_NAME_OF_THE_
37e0: 45 58 45 43 55 54 41 42 4c 45 5f 31 29 2e 22 0a  EXECUTABLE_1).".
37f0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
3800: 49 44 3d 3d 27 38 34 63 64 39 36 34 35 2d 32 61  ID=='84cd9645-2a
3810: 31 62 2d 34 38 38 31 2d 61 35 36 66 2d 38 30 32  1b-4881-a56f-802
3820: 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
3830: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
3840: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
3850: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
3860: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
3870: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
3880: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
3890: 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f  -----.    S_TMP_
38a0: 30 3d 22 5c 60 77 68 69 63 68 20 24 53 5f 4e 41  0="\`which $S_NA
38b0: 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54  ME_OF_THE_EXECUT
38c0: 41 42 4c 45 5f 31 20 32 3e 2f 64 65 76 2f 6e 75  ABLE_1 2>/dev/nu
38d0: 6c 6c 5c 60 22 0a 20 20 20 20 6c 6f 63 61 6c 20  ll\`".    local 
38e0: 53 5f 54 4d 50 5f 32 3d 22 53 5f 54 4d 50 5f 31  S_TMP_2="S_TMP_1
38f0: 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 65  =$S_TMP_0".    e
3900: 76 61 6c 20 24 7b 53 5f 54 4d 50 5f 32 7d 0a 20  val ${S_TMP_2}. 
3910: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20     #----.    if 
3920: 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d 3d 20  [ "$S_TMP_1" == 
3930: 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  "" ] ; then.    
3940: 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f 4f 4e      SB_EXISTS_ON
3950: 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 3d  _PATH_T1_RESULT=
3960: 22 66 22 0a 20 20 20 20 65 6c 73 65 0a 20 20 20  "f".    else.   
3970: 20 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f 4f       SB_EXISTS_O
3980: 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
3990: 3d 22 74 22 0a 20 20 20 20 66 69 0a 7d 20 23 20  ="t".    fi.} # 
39a0: 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f  func_sb_exists_o
39b0: 6e 5f 70 61 74 68 5f 74 31 20 0a 0a 0a 0a 66 75  n_path_t1 ....fu
39c0: 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73  nc_assert_exists
39d0: 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 28 29 20 7b  _on_path_t2 () {
39e0: 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 4e 41 4d  .    local S_NAM
39f0: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
3a00: 42 4c 45 5f 31 3d 22 24 31 22 20 23 20 66 69 72  BLE_1="$1" # fir
3a10: 73 74 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75  st function argu
3a20: 6d 65 6e 74 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ment.    local S
3a30: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
3a40: 43 55 54 41 42 4c 45 5f 32 3d 22 24 32 22 20 23  CUTABLE_2="$2" #
3a50: 20 6f 70 74 69 6f 6e 61 6c 20 61 72 67 75 6d 65   optional argume
3a60: 6e 74 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 4e  nt.    local S_N
3a70: 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55  AME_OF_THE_EXECU
3a80: 54 41 42 4c 45 5f 33 3d 22 24 33 22 20 23 20 6f  TABLE_3="$3" # o
3a90: 70 74 69 6f 6e 61 6c 20 61 72 67 75 6d 65 6e 74  ptional argument
3aa0: 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 4e 41 4d  .    local S_NAM
3ab0: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
3ac0: 42 4c 45 5f 34 3d 22 24 34 22 20 23 20 6f 70 74  BLE_4="$4" # opt
3ad0: 69 6f 6e 61 6c 20 61 72 67 75 6d 65 6e 74 0a 20  ional argument. 
3ae0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
3af0: 20 23 20 46 75 6e 63 74 69 6f 6e 20 63 61 6c 6c   # Function call
3b00: 73 20 6c 69 6b 65 0a 20 20 20 20 23 0a 20 20 20  s like.    #.   
3b10: 20 23 20 20 20 20 20 66 75 6e 63 5f 61 73 73 65   #     func_asse
3b20: 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74  rt_exists_on_pat
3b30: 68 5f 74 32 20 20 22 22 20 20 20 20 22 22 20 20  h_t2  ""    ""  
3b40: 22 6c 73 22 0a 20 20 20 20 23 20 20 20 20 20 66  "ls".    #     f
3b50: 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74  unc_assert_exist
3b60: 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 20 22 6c  s_on_path_t2  "l
3b70: 73 22 20 20 22 22 20 20 22 70 73 22 0a 20 20 20  s"  ""  "ps".   
3b80: 20 23 0a 20 20 20 20 23 20 61 72 65 20 6e 6f 74   #.    # are not
3b90: 20 61 6c 6c 6f 77 65 64 20 62 79 20 74 68 65 20   allowed by the 
3ba0: 73 70 65 63 20 6f 66 20 74 68 69 73 20 66 75 6e  spec of this fun
3bb0: 63 74 69 6f 6e 2c 20 62 75 74 20 69 74 27 73 20  ction, but it's 
3bc0: 4f 4b 20 74 6f 20 63 61 6c 6c 0a 20 20 20 20 23  OK to call.    #
3bd0: 0a 20 20 20 20 23 20 20 20 20 20 66 75 6e 63 5f  .    #     func_
3be0: 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e  assert_exists_on
3bf0: 5f 70 61 74 68 5f 74 32 20 20 22 6c 73 22 20 22  _path_t2  "ls" "
3c00: 22 20 0a 20 20 20 20 23 20 20 20 20 20 66 75 6e  " .    #     fun
3c10: 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f  c_assert_exists_
3c20: 6f 6e 5f 70 61 74 68 5f 74 32 20 20 22 6c 73 22  on_path_t2  "ls"
3c30: 20 22 70 73 22 20 22 22 0a 20 20 20 20 23 20 20   "ps" "".    #  
3c40: 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 65     func_assert_e
3c50: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32  xists_on_path_t2
3c60: 20 20 22 6c 73 22 20 22 22 20 20 20 22 22 20 22    "ls" ""   "" "
3c70: 22 0a 20 20 20 20 23 0a 20 20 20 20 23 0a 20 20  ".    #.    #.  
3c80: 20 20 6c 6f 63 61 6c 20 53 42 5f 54 48 52 4f 57    local SB_THROW
3c90: 3d 22 66 22 0a 20 20 20 20 69 66 20 5b 20 22 24  ="f".    if [ "$
3ca0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
3cb0: 45 43 55 54 41 42 4c 45 5f 31 22 20 3d 3d 20 22  ECUTABLE_1" == "
3cc0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
3cd0: 20 20 20 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a     SB_THROW="t".
3ce0: 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20      else.       
3cf0: 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f   if [ "$S_NAME_O
3d00: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
3d10: 5f 32 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  _2" == "" ] ; th
3d20: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 69  en.            i
3d30: 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  f [ "$S_NAME_OF_
3d40: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 33  THE_EXECUTABLE_3
3d50: 22 20 21 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e  " != "" ] ; then
3d60: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
3d70: 20 53 42 5f 54 48 52 4f 57 3d 22 74 22 0a 20 20   SB_THROW="t".  
3d80: 20 20 20 20 20 20 20 20 20 20 66 69 0a 20 20 20            fi.   
3d90: 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24           if [ "$
3da0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
3db0: 45 43 55 54 41 42 4c 45 5f 34 22 20 21 3d 20 22  ECUTABLE_4" != "
3dc0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
3dd0: 20 20 20 20 20 20 20 20 20 20 20 53 42 5f 54 48             SB_TH
3de0: 52 4f 57 3d 22 74 22 0a 20 20 20 20 20 20 20 20  ROW="t".        
3df0: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 65      fi.        e
3e00: 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20  lse.            
3e10: 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46  if [ "$S_NAME_OF
3e20: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
3e30: 33 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65  3" == "" ] ; the
3e40: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  n.              
3e50: 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f    if [ "$S_NAME_
3e60: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
3e70: 45 5f 34 22 20 21 3d 20 22 22 20 5d 20 3b 20 74  E_4" != "" ] ; t
3e80: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
3e90: 20 20 20 20 20 20 20 20 53 42 5f 54 48 52 4f 57          SB_THROW
3ea0: 3d 22 74 22 0a 20 20 20 20 20 20 20 20 20 20 20  ="t".           
3eb0: 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
3ec0: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66      fi.        f
3ed0: 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  i.    fi.    #--
3ee0: 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 42  --.    if [ "$SB
3ef0: 5f 54 48 52 4f 57 22 20 3d 3d 20 22 74 22 20 5d  _THROW" == "t" ]
3f00: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
3f10: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
3f20: 65 63 68 6f 20 22 54 68 65 20 42 61 73 68 20 66  echo "The Bash f
3f30: 75 6e 63 74 69 6f 6e 20 22 0a 20 20 20 20 20 20  unction ".      
3f40: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
3f50: 20 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63    echo "    func
3f60: 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f  _assert_exists_o
3f70: 6e 5f 70 61 74 68 5f 74 32 20 22 0a 20 20 20 20  n_path_t2 ".    
3f80: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
3f90: 20 20 20 20 65 63 68 6f 20 22 69 73 20 6e 6f 74      echo "is not
3fa0: 20 64 65 73 69 67 6e 65 64 20 74 6f 20 68 61 6e   designed to han
3fb0: 64 6c 65 20 73 65 72 69 65 73 20 6f 66 20 61 72  dle series of ar
3fc0: 67 75 6d 65 6e 74 73 2c 20 77 68 65 72 65 20 22  guments, where "
3fd0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65  .        echo "e
3fe0: 6d 70 74 79 20 73 74 72 69 6e 67 73 20 70 72 65  mpty strings pre
3ff0: 63 65 64 65 20 6e 6f 6e 2d 65 6d 70 74 79 20 73  cede non-empty s
4000: 74 72 69 6e 67 73 2e 22 0a 20 20 20 20 20 20 20  trings.".       
4010: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 31 66   echo "GUID=='1f
4020: 37 65 66 32 33 35 2d 32 31 38 32 2d 34 34 63 37  7ef235-2182-44c7
4030: 2d 61 32 36 66 2d 38 30 32 30 37 30 65 30 33 31  -a26f-802070e031
4040: 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
4050: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  o "".        #--
4060: 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
4070: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
4080: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
4090: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69  ith error.    fi
40a0: 0a 20 20 20 20 69 66 20 5b 20 22 24 35 22 20 21  .    if [ "$5" !
40b0: 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  = "" ] ; then.  
40c0: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
40d0: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73        echo "This
40e0: 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 20 69   Bash function i
40f0: 73 20 64 65 73 69 67 6e 65 64 20 74 6f 20 77 6f  s designed to wo
4100: 72 6b 20 77 69 74 68 20 61 74 20 6d 6f 73 74 20  rk with at most 
4110: 34 20 69 6e 70 75 74 20 61 72 67 75 6d 65 6e 74  4 input argument
4120: 73 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  s".        echo 
4130: 22 47 55 49 44 3d 3d 27 37 39 34 61 64 38 34 62  "GUID=='794ad84b
4140: 2d 61 30 38 61 2d 34 32 34 65 2d 38 31 36 66 2d  -a08a-424e-816f-
4150: 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
4160: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
4170: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
4180: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
4190: 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
41a0: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
41b0: 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
41c0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 46  --------.    # F
41d0: 75 6e 63 74 69 6f 6e 20 63 61 6c 6c 73 20 6c 69  unction calls li
41e0: 6b 65 0a 20 20 20 20 23 0a 20 20 20 20 23 20 20  ke.    #.    #  
41f0: 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 65     func_assert_e
4200: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32  xists_on_path_t2
4210: 20 22 20 22 0a 20 20 20 20 23 20 20 20 20 20 66   " ".    #     f
4220: 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74  unc_assert_exist
4230: 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 6c 73  s_on_path_t2 "ls
4240: 20 70 73 22 20 23 20 63 6f 6e 74 61 69 6e 73 20   ps" # contains 
4250: 61 20 73 70 61 63 65 0a 20 20 20 20 23 0a 20 20  a space.    #.  
4260: 20 20 23 20 61 72 65 20 6e 6f 74 20 61 6c 6c 6f    # are not allo
4270: 77 65 64 2e 0a 20 20 20 20 53 42 5f 54 48 52 4f  wed..    SB_THRO
4280: 57 3d 22 66 22 20 0a 20 20 20 20 6c 6f 63 61 6c  W="f" .    local
4290: 20 53 5f 54 4d 50 5f 30 3d 22 22 0a 20 20 20 20   S_TMP_0="".    
42a0: 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22 22  local S_TMP_1=""
42b0: 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50  .    local S_TMP
42c0: 5f 32 3d 22 22 0a 20 20 20 20 23 2d 2d 2d 2d 0a  _2="".    #----.
42d0: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 54 48      if [ "$SB_TH
42e0: 52 4f 57 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20  ROW" == "f" ] ; 
42f0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54  then.        S_T
4300: 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c  MP_0="`ruby -e \
4310: 22 70 72 69 6e 74 28 27 24 53 5f 4e 41 4d 45 5f  "print('$S_NAME_
4320: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
4330: 45 5f 31 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f  E_1'.to_s.gsub(/
4340: 5b 5c 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60  [\s]+/,''));\" `
4350: 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  ".        if [ "
4360: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
4370: 58 45 43 55 54 41 42 4c 45 5f 31 22 20 21 3d 20  XECUTABLE_1" != 
4380: 22 24 53 5f 54 4d 50 5f 30 22 20 5d 20 3b 20 74  "$S_TMP_0" ] ; t
4390: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
43a0: 53 42 5f 54 48 52 4f 57 3d 22 74 22 20 0a 20 20  SB_THROW="t" .  
43b0: 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f            S_TMP_
43c0: 31 3d 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48  1="$S_NAME_OF_TH
43d0: 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 22 0a  E_EXECUTABLE_1".
43e0: 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
43f0: 50 5f 32 3d 22 47 55 49 44 3d 3d 27 31 33 66 38  P_2="GUID=='13f8
4400: 35 38 39 34 2d 30 66 36 33 2d 34 66 35 64 2d 38  5894-0f63-4f5d-8
4410: 35 35 66 2d 38 30 32 30 37 30 65 30 33 31 65 37  55f-802070e031e7
4420: 27 22 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  '".        fi.  
4430: 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20    fi.    #----. 
4440: 20 20 20 69 66 20 5b 20 22 24 53 42 5f 54 48 52     if [ "$SB_THR
4450: 4f 57 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74  OW" == "f" ] ; t
4460: 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d  hen.        S_TM
4470: 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22  P_0="`ruby -e \"
4480: 70 72 69 6e 74 28 27 24 53 5f 4e 41 4d 45 5f 4f  print('$S_NAME_O
4490: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
44a0: 5f 32 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b  _2'.to_s.gsub(/[
44b0: 5c 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22  \s]+/,''));\" `"
44c0: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
44d0: 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58  S_NAME_OF_THE_EX
44e0: 45 43 55 54 41 42 4c 45 5f 32 22 20 21 3d 20 22  ECUTABLE_2" != "
44f0: 24 53 5f 54 4d 50 5f 30 22 20 5d 20 3b 20 74 68  $S_TMP_0" ] ; th
4500: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53  en.            S
4510: 42 5f 54 48 52 4f 57 3d 22 74 22 20 0a 20 20 20  B_THROW="t" .   
4520: 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 31           S_TMP_1
4530: 3d 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  ="$S_NAME_OF_THE
4540: 5f 45 58 45 43 55 54 41 42 4c 45 5f 32 22 0a 20  _EXECUTABLE_2". 
4550: 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50             S_TMP
4560: 5f 32 3d 22 47 55 49 44 3d 3d 27 35 38 64 33 65  _2="GUID=='58d3e
4570: 37 38 32 2d 64 65 35 38 2d 34 39 34 38 2d 39 35  782-de58-4948-95
4580: 35 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  5f-802070e031e7'
4590: 22 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  ".        fi.   
45a0: 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20   fi.    #----.  
45b0: 20 20 69 66 20 5b 20 22 24 53 42 5f 54 48 52 4f    if [ "$SB_THRO
45c0: 57 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68  W" == "f" ] ; th
45d0: 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50  en.        S_TMP
45e0: 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70  _0="`ruby -e \"p
45f0: 72 69 6e 74 28 27 24 53 5f 4e 41 4d 45 5f 4f 46  rint('$S_NAME_OF
4600: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
4610: 33 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c  3'.to_s.gsub(/[\
4620: 73 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a  s]+/,''));\" `".
4630: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
4640: 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45  _NAME_OF_THE_EXE
4650: 43 55 54 41 42 4c 45 5f 33 22 20 21 3d 20 22 24  CUTABLE_3" != "$
4660: 53 5f 54 4d 50 5f 30 22 20 5d 20 3b 20 74 68 65  S_TMP_0" ] ; the
4670: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 42  n.            SB
4680: 5f 54 48 52 4f 57 3d 22 74 22 20 0a 20 20 20 20  _THROW="t" .    
4690: 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 31 3d          S_TMP_1=
46a0: 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
46b0: 45 58 45 43 55 54 41 42 4c 45 5f 33 22 0a 20 20  EXECUTABLE_3".  
46c0: 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f            S_TMP_
46d0: 32 3d 22 47 55 49 44 3d 3d 27 34 35 38 36 32 31  2="GUID=='458621
46e0: 64 66 2d 62 61 61 65 2d 34 34 62 33 2d 38 34 35  df-baae-44b3-845
46f0: 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22  f-802070e031e7'"
4700: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
4710: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20  fi.    #----.   
4720: 20 69 66 20 5b 20 22 24 53 42 5f 54 48 52 4f 57   if [ "$SB_THROW
4730: 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65  " == "f" ] ; the
4740: 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  n.        S_TMP_
4750: 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70 72  0="`ruby -e \"pr
4760: 69 6e 74 28 27 24 53 5f 4e 41 4d 45 5f 4f 46 5f  int('$S_NAME_OF_
4770: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 34  THE_EXECUTABLE_4
4780: 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c 73  '.to_s.gsub(/[\s
4790: 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20  ]+/,''));\" `". 
47a0: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
47b0: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
47c0: 55 54 41 42 4c 45 5f 34 22 20 21 3d 20 22 24 53  UTABLE_4" != "$S
47d0: 5f 54 4d 50 5f 30 22 20 5d 20 3b 20 74 68 65 6e  _TMP_0" ] ; then
47e0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 42 5f  .            SB_
47f0: 54 48 52 4f 57 3d 22 74 22 20 0a 20 20 20 20 20  THROW="t" .     
4800: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22         S_TMP_1="
4810: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
4820: 58 45 43 55 54 41 42 4c 45 5f 34 22 0a 20 20 20  XECUTABLE_4".   
4830: 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 32           S_TMP_2
4840: 3d 22 47 55 49 44 3d 3d 27 65 34 37 62 30 66 32  ="GUID=='e47b0f2
4850: 31 2d 63 61 35 32 2d 34 63 31 36 2d 39 32 35 66  1-ca52-4c16-925f
4860: 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
4870: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 66          fi.    f
4880: 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
4890: 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 54 48      if [ "$SB_TH
48a0: 52 4f 57 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20  ROW" == "t" ] ; 
48b0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
48c0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
48d0: 6f 20 22 54 68 65 20 42 61 73 68 20 66 75 6e 63  o "The Bash func
48e0: 74 69 6f 6e 20 22 0a 20 20 20 20 20 20 20 20 65  tion ".        e
48f0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
4900: 63 68 6f 20 22 20 20 20 20 66 75 6e 63 5f 61 73  cho "    func_as
4910: 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70  sert_exists_on_p
4920: 61 74 68 5f 74 32 20 22 0a 20 20 20 20 20 20 20  ath_t2 ".       
4930: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
4940: 20 65 63 68 6f 20 22 69 73 20 6e 6f 74 20 64 65   echo "is not de
4950: 73 69 67 6e 65 64 20 74 6f 20 68 61 6e 64 6c 65  signed to handle
4960: 20 61 6e 20 61 72 67 75 6d 65 6e 74 20 76 61 6c   an argument val
4970: 75 65 20 74 68 61 74 20 63 6f 6e 74 61 69 6e 73  ue that contains
4980: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
4990: 22 73 70 61 63 65 73 20 6f 72 20 74 61 62 75 6c  "spaces or tabul
49a0: 61 74 69 6f 6e 20 63 68 61 72 61 63 74 65 72 73  ation characters
49b0: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
49c0: 22 54 68 65 20 75 6e 61 63 63 65 70 74 65 64 20  "The unaccepted 
49d0: 76 61 6c 75 65 20 69 6e 20 70 61 72 65 6e 74 68  value in parenth
49e0: 65 73 69 73 3a 28 24 53 5f 54 4d 50 5f 31 29 2e  esis:($S_TMP_1).
49f0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
4a00: 42 72 61 6e 63 68 20 24 53 5f 54 4d 50 5f 32 2e  Branch $S_TMP_2.
4a10: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
4a20: 47 55 49 44 3d 3d 27 37 66 37 36 33 30 33 31 2d  GUID=='7f763031-
4a30: 30 64 66 65 2d 34 61 65 36 2d 38 33 35 66 2d 38  0dfe-4ae6-835f-8
4a40: 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20  02070e031e7'".  
4a50: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
4a60: 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
4a70: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
4a80: 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
4a90: 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
4aa0: 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 53 42  or.    fi.    SB
4ab0: 5f 54 48 52 4f 57 3d 22 66 22 20 23 20 4a 75 73  _THROW="f" # Jus
4ac0: 74 20 61 20 72 65 73 65 74 2c 20 73 68 6f 75 6c  t a reset, shoul
4ad0: 64 20 49 20 66 6f 72 67 65 74 20 74 6f 20 72 65  d I forget to re
4ae0: 73 65 74 20 69 74 20 6c 61 74 65 72 2e 0a 20 20  set it later..  
4af0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
4b00: 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22  --.    S_TMP_0="
4b10: 5c 60 77 68 69 63 68 20 24 53 5f 4e 41 4d 45 5f  \`which $S_NAME_
4b20: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
4b30: 45 5f 31 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 5c  E_1 2>/dev/null\
4b40: 60 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54  `".    local S_T
4b50: 4d 50 5f 31 3d 22 22 0a 20 20 20 20 6c 6f 63 61  MP_1="".    loca
4b60: 6c 20 53 5f 54 4d 50 5f 32 3d 22 53 5f 54 4d 50  l S_TMP_2="S_TMP
4b70: 5f 31 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  _1=$S_TMP_0".   
4b80: 20 65 76 61 6c 20 24 7b 53 5f 54 4d 50 5f 32 7d   eval ${S_TMP_2}
4b90: 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69  .    #----.    i
4ba0: 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d  f [ "$S_TMP_1" =
4bb0: 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  = "" ] ; then.  
4bc0: 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f 4e        if [ "$S_N
4bd0: 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55  AME_OF_THE_EXECU
4be0: 54 41 42 4c 45 5f 32 22 20 3d 3d 20 22 22 20 5d  TABLE_2" == "" ]
4bf0: 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
4c00: 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46  if [ "$S_NAME_OF
4c10: 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f  _THE_EXECUTABLE_
4c20: 33 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65  3" == "" ] ; the
4c30: 6e 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  n.        if [ "
4c40: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
4c50: 58 45 43 55 54 41 42 4c 45 5f 34 22 20 3d 3d 20  XECUTABLE_4" == 
4c60: 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  "" ] ; then.    
4c70: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
4c80: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
4c90: 20 22 54 68 69 73 20 62 61 73 68 20 73 63 72 69   "This bash scri
4ca0: 70 74 20 72 65 71 75 69 72 65 73 20 74 68 65 20  pt requires the 
4cb0: 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  \"$S_NAME_OF_THE
4cc0: 5f 45 58 45 43 55 54 41 42 4c 45 5f 31 5c 22 20  _EXECUTABLE_1\" 
4cd0: 74 6f 20 62 65 20 6f 6e 20 74 68 65 20 50 41 54  to be on the PAT
4ce0: 48 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  H.".            
4cf0: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 37 66 32  echo "GUID=='7f2
4d00: 32 36 34 66 31 2d 61 34 31 36 2d 34 66 39 38 2d  264f1-a416-4f98-
4d10: 38 33 34 66 2d 38 30 32 30 37 30 65 30 33 31 65  834f-802070e031e
4d20: 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
4d30: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
4d40: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
4d50: 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
4d60: 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20  RIG.            
4d70: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
4d80: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20  th error.       
4d90: 20 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20   fi.        fi. 
4da0: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 65 6c         fi.    el
4db0: 73 65 0a 20 20 20 20 20 20 20 20 72 65 74 75 72  se.        retur
4dc0: 6e 20 23 20 61 74 20 6c 65 61 73 74 20 6f 6e 65  n # at least one
4dd0: 20 6f 66 20 74 68 65 20 70 72 6f 67 72 61 6d 73   of the programs
4de0: 20 77 61 73 20 61 76 61 69 6c 61 62 6c 65 20 61   was available a
4df0: 74 20 74 68 65 20 50 41 54 48 0a 20 20 20 20 66  t the PATH.    f
4e00: 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
4e10: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 5c 60 77      S_TMP_0="\`w
4e20: 68 69 63 68 20 24 53 5f 4e 41 4d 45 5f 4f 46 5f  hich $S_NAME_OF_
4e30: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 32  THE_EXECUTABLE_2
4e40: 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 5c 60 22 0a   2>/dev/null\`".
4e50: 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22 22 0a 20      S_TMP_1="". 
4e60: 20 20 20 53 5f 54 4d 50 5f 32 3d 22 53 5f 54 4d     S_TMP_2="S_TM
4e70: 50 5f 31 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20  P_1=$S_TMP_0".  
4e80: 20 20 65 76 61 6c 20 24 7b 53 5f 54 4d 50 5f 32    eval ${S_TMP_2
4e90: 7d 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  }.    #----.    
4ea0: 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20  if [ "$S_TMP_1" 
4eb0: 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20  == "" ] ; then. 
4ec0: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
4ed0: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
4ee0: 55 54 41 42 4c 45 5f 33 22 20 3d 3d 20 22 22 20  UTABLE_3" == "" 
4ef0: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
4f00: 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f   if [ "$S_NAME_O
4f10: 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45  F_THE_EXECUTABLE
4f20: 5f 34 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  _4" == "" ] ; th
4f30: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
4f40: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
4f50: 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 62 61     echo "This ba
4f60: 73 68 20 73 63 72 69 70 74 20 72 65 71 75 69 72  sh script requir
4f70: 65 73 20 74 68 61 74 20 65 69 74 68 65 72 20 5c  es that either \
4f80: 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
4f90: 45 58 45 43 55 54 41 42 4c 45 5f 31 5c 22 20 6f  EXECUTABLE_1\" o
4fa0: 72 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  r ".            
4fb0: 65 63 68 6f 20 22 20 5c 22 24 53 5f 4e 41 4d 45  echo " \"$S_NAME
4fc0: 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42  _OF_THE_EXECUTAB
4fd0: 4c 45 5f 32 5c 22 20 69 73 20 61 76 61 69 6c 61  LE_2\" is availa
4fe0: 62 6c 65 20 6f 6e 20 74 68 65 20 50 41 54 48 2e  ble on the PATH.
4ff0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
5000: 68 6f 20 22 47 55 49 44 3d 3d 27 37 62 61 64 35  ho "GUID=='7bad5
5010: 32 34 38 2d 61 65 64 64 2d 34 62 39 32 2d 62 32  248-aedd-4b92-b2
5020: 34 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  4f-802070e031e7'
5030: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
5040: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
5050: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
5060: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
5070: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
5080: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
5090: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
50a0: 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  i.        fi.   
50b0: 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 72 65   else.        re
50c0: 74 75 72 6e 20 23 20 61 74 20 6c 65 61 73 74 20  turn # at least 
50d0: 6f 6e 65 20 6f 66 20 74 68 65 20 70 72 6f 67 72  one of the progr
50e0: 61 6d 73 20 77 61 73 20 61 76 61 69 6c 61 62 6c  ams was availabl
50f0: 65 20 61 74 20 74 68 65 20 50 41 54 48 0a 20 20  e at the PATH.  
5100: 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
5110: 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22  --.    S_TMP_0="
5120: 5c 60 77 68 69 63 68 20 24 53 5f 4e 41 4d 45 5f  \`which $S_NAME_
5130: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
5140: 45 5f 33 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 5c  E_3 2>/dev/null\
5150: 60 22 0a 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22  `".    S_TMP_1="
5160: 22 0a 20 20 20 20 53 5f 54 4d 50 5f 32 3d 22 53  ".    S_TMP_2="S
5170: 5f 54 4d 50 5f 31 3d 24 53 5f 54 4d 50 5f 30 22  _TMP_1=$S_TMP_0"
5180: 0a 20 20 20 20 65 76 61 6c 20 24 7b 53 5f 54 4d  .    eval ${S_TM
5190: 50 5f 32 7d 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20  P_2}.    #----. 
51a0: 20 20 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f     if [ "$S_TMP_
51b0: 31 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65  1" == "" ] ; the
51c0: 6e 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  n.        if [ "
51d0: 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45  $S_NAME_OF_THE_E
51e0: 58 45 43 55 54 41 42 4c 45 5f 34 22 20 3d 3d 20  XECUTABLE_4" == 
51f0: 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  "" ] ; then.    
5200: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
5210: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
5220: 20 22 54 68 69 73 20 62 61 73 68 20 73 63 72 69   "This bash scri
5230: 70 74 20 72 65 71 75 69 72 65 73 20 74 68 61 74  pt requires that
5240: 20 65 69 74 68 65 72 20 5c 22 24 53 5f 4e 41 4d   either \"$S_NAM
5250: 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41  E_OF_THE_EXECUTA
5260: 42 4c 45 5f 31 5c 22 20 6f 72 20 22 0a 20 20 20  BLE_1\" or ".   
5270: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20           echo " 
5280: 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45  \"$S_NAME_OF_THE
5290: 5f 45 58 45 43 55 54 41 42 4c 45 5f 32 5c 22 20  _EXECUTABLE_2\" 
52a0: 6f 72 20 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  or \"$S_NAME_OF_
52b0: 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 33  THE_EXECUTABLE_3
52c0: 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  \" ".           
52d0: 20 65 63 68 6f 20 22 69 73 20 61 76 61 69 6c 61   echo "is availa
52e0: 62 6c 65 20 6f 6e 20 74 68 65 20 50 41 54 48 2e  ble on the PATH.
52f0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
5300: 68 6f 20 22 47 55 49 44 3d 3d 27 35 32 64 61 32  ho "GUID=='52da2
5310: 63 62 37 2d 66 35 64 33 2d 34 61 64 61 2d 62 31  cb7-f5d3-4ada-b1
5320: 34 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  4f-802070e031e7'
5330: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
5340: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
5350: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
5360: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
5370: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
5380: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
5390: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
53a0: 69 0a 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20  i.    else.     
53b0: 20 20 20 72 65 74 75 72 6e 20 23 20 61 74 20 6c     return # at l
53c0: 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 20  east one of the 
53d0: 70 72 6f 67 72 61 6d 73 20 77 61 73 20 61 76 61  programs was ava
53e0: 69 6c 61 62 6c 65 20 61 74 20 74 68 65 20 50 41  ilable at the PA
53f0: 54 48 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  TH.    fi.    #-
5400: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d  -------.    S_TM
5410: 50 5f 30 3d 22 5c 60 77 68 69 63 68 20 24 53 5f  P_0="\`which $S_
5420: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
5430: 55 54 41 42 4c 45 5f 34 20 32 3e 2f 64 65 76 2f  UTABLE_4 2>/dev/
5440: 6e 75 6c 6c 5c 60 22 0a 20 20 20 20 53 5f 54 4d  null\`".    S_TM
5450: 50 5f 31 3d 22 22 0a 20 20 20 20 53 5f 54 4d 50  P_1="".    S_TMP
5460: 5f 32 3d 22 53 5f 54 4d 50 5f 31 3d 24 53 5f 54  _2="S_TMP_1=$S_T
5470: 4d 50 5f 30 22 0a 20 20 20 20 65 76 61 6c 20 24  MP_0".    eval $
5480: 7b 53 5f 54 4d 50 5f 32 7d 0a 20 20 20 20 23 2d  {S_TMP_2}.    #-
5490: 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
54a0: 5f 54 4d 50 5f 31 22 20 3d 3d 20 22 22 20 5d 20  _TMP_1" == "" ] 
54b0: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
54c0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
54d0: 63 68 6f 20 22 54 68 69 73 20 62 61 73 68 20 73  cho "This bash s
54e0: 63 72 69 70 74 20 72 65 71 75 69 72 65 73 20 74  cript requires t
54f0: 68 61 74 20 65 69 74 68 65 72 20 5c 22 24 53 5f  hat either \"$S_
5500: 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f 45 58 45 43  NAME_OF_THE_EXEC
5510: 55 54 41 42 4c 45 5f 31 5c 22 20 6f 72 20 22 0a  UTABLE_1\" or ".
5520: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 5c          echo " \
5530: 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54 48 45 5f  "$S_NAME_OF_THE_
5540: 45 58 45 43 55 54 41 42 4c 45 5f 32 5c 22 20 6f  EXECUTABLE_2\" o
5550: 72 20 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54  r \"$S_NAME_OF_T
5560: 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 33 5c  HE_EXECUTABLE_3\
5570: 22 20 6f 72 20 22 0a 20 20 20 20 20 20 20 20 65  " or ".        e
5580: 63 68 6f 20 22 20 5c 22 24 53 5f 4e 41 4d 45 5f  cho " \"$S_NAME_
5590: 4f 46 5f 54 48 45 5f 45 58 45 43 55 54 41 42 4c  OF_THE_EXECUTABL
55a0: 45 5f 34 5c 22 20 69 73 20 61 76 61 69 6c 61 62  E_4\" is availab
55b0: 6c 65 20 6f 6e 20 74 68 65 20 50 41 54 48 2e 22  le on the PATH."
55c0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
55d0: 55 49 44 3d 3d 27 30 66 31 39 35 34 32 62 2d 62  UID=='0f19542b-b
55e0: 32 39 66 2d 34 38 63 62 2d 61 34 34 66 2d 38 30  29f-48cb-a44f-80
55f0: 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  2070e031e7'".   
5600: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
5610: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
5620: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
5630: 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
5640: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
5650: 72 0a 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20  r.    else.     
5660: 20 20 20 72 65 74 75 72 6e 20 23 20 61 74 20 6c     return # at l
5670: 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 20  east one of the 
5680: 70 72 6f 67 72 61 6d 73 20 77 61 73 20 61 76 61  programs was ava
5690: 69 6c 61 62 6c 65 20 61 74 20 74 68 65 20 50 41  ilable at the PA
56a0: 54 48 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  TH.    fi.    #-
56b0: 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66 75 6e 63  -------.} # func
56c0: 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f  _assert_exists_o
56d0: 6e 5f 70 61 74 68 5f 74 32 0a 0a 66 75 6e 63 5f  n_path_t2..func_
56e0: 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e  assert_exists_on
56f0: 5f 70 61 74 68 5f 74 32 20 22 62 61 73 68 22 20  _path_t2 "bash" 
5700: 20 20 20 20 23 20 74 68 69 73 20 69 73 20 61 20      # this is a 
5710: 62 61 73 68 20 73 63 72 69 70 74 20 69 74 73 65  bash script itse
5720: 6c 66 2c 20 62 75 74 0a 20 20 20 20 20 20 20 20  lf, but.        
5730: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5740: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5750: 20 23 20 69 74 20 6d 69 67 68 74 20 68 61 76 65   # it might have
5760: 20 62 65 65 6e 20 65 78 65 63 75 74 65 64 20 62   been executed b
5770: 79 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  y .             
5780: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
5790: 20 20 20 20 20 20 20 20 20 20 20 20 23 20 73 70              # sp
57a0: 65 63 69 66 79 69 6e 67 20 74 68 65 20 66 75 6c  ecifying the ful
57b0: 6c 20 70 61 74 68 20 74 6f 20 74 68 65 20 62 61  l path to the ba
57c0: 73 68 20 63 6f 6d 6d 61 6e 64 2c 0a 20 20 20 20  sh command,.    
57d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
57e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
57f0: 20 20 20 20 20 23 20 77 69 74 68 6f 75 74 20 68       # without h
5800: 61 76 69 6e 67 20 74 68 65 20 62 61 73 68 20 61  aving the bash a
5810: 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 65 20  vailable on the 
5820: 50 41 54 48 2e 0a 0a 66 75 6e 63 5f 61 73 73 65  PATH...func_asse
5830: 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74  rt_exists_on_pat
5840: 68 5f 74 32 20 22 62 61 73 65 6e 61 6d 65 22 20  h_t2 "basename" 
5850: 23 20 66 6f 72 20 65 78 74 72 61 63 74 69 6e 67  # for extracting
5860: 20 66 69 6c 65 20 6e 61 6d 65 73 20 66 72 6f 6d   file names from
5870: 20 66 75 6c 6c 20 70 61 74 68 73 0a 66 75 6e 63   full paths.func
5880: 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f  _assert_exists_o
5890: 6e 5f 70 61 74 68 5f 74 32 20 22 63 61 74 22 20  n_path_t2 "cat" 
58a0: 20 20 20 23 20 6f 70 70 6f 73 69 74 65 20 74 6f     # opposite to
58b0: 20 73 70 6c 69 74 0a 66 75 6e 63 5f 61 73 73 65   split.func_asse
58c0: 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74  rt_exists_on_pat
58d0: 68 5f 74 32 20 22 73 68 61 32 35 36 73 75 6d 22  h_t2 "sha256sum"
58e0: 20 22 73 68 61 32 35 36 22 20 22 72 68 61 73 68   "sha256" "rhash
58f0: 22 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78  ".func_assert_ex
5900: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20  ists_on_path_t2 
5910: 22 74 69 67 65 72 64 65 65 70 22 20 22 72 68 61  "tigerdeep" "rha
5920: 73 68 22 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f  sh".func_assert_
5930: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
5940: 32 20 22 77 68 69 72 6c 70 6f 6f 6c 64 65 65 70  2 "whirlpooldeep
5950: 22 20 22 72 68 61 73 68 22 0a 66 75 6e 63 5f 61  " "rhash".func_a
5960: 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f  ssert_exists_on_
5970: 70 61 74 68 5f 74 32 20 22 74 61 72 22 0a 23 2d  path_t2 "tar".#-
5980: 2d 2d 2d 2d 2d 2d 2d 0a 66 75 6e 63 5f 61 73 73  -------.func_ass
5990: 65 72 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61  ert_exists_on_pa
59a0: 74 68 5f 74 32 20 22 66 69 6c 65 22 20 20 20 23  th_t2 "file"   #
59b0: 20 66 6f 72 20 63 68 65 63 6b 69 6e 67 20 74 68   for checking th
59c0: 65 20 4d 49 4d 45 20 74 79 70 65 20 6f 66 20 74  e MIME type of t
59d0: 68 65 20 70 6f 74 65 6e 74 69 61 6c 20 74 61 72  he potential tar
59e0: 20 66 69 6c 65 0a 66 75 6e 63 5f 61 73 73 65 72   file.func_asser
59f0: 74 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  t_exists_on_path
5a00: 5f 74 32 20 22 66 69 6c 65 73 69 7a 65 22 20 22  _t2 "filesize" "
5a10: 72 75 62 79 22 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ruby".#--------.
5a20: 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  # The following 
5a30: 63 6f 6d 6d 61 6e 64 73 20 68 61 76 65 20 62 65  commands have be
5a40: 65 6e 20 61 6c 72 65 61 64 79 20 63 68 65 63 6b  en already check
5a50: 65 64 20 61 74 20 74 68 65 20 73 74 61 72 74 20  ed at the start 
5a60: 6f 66 20 74 68 69 73 20 63 72 69 70 74 2e 0a 23  of this cript..#
5a70: 20 20 20 20 20 66 75 6e 63 5f 61 73 73 65 72 74       func_assert
5a80: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
5a90: 74 32 20 22 67 61 77 6b 22 20 0a 23 20 20 20 20  t2 "gawk" .#    
5aa0: 20 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78 69   func_assert_exi
5ab0: 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22  sts_on_path_t2 "
5ac0: 67 72 65 70 22 0a 23 20 20 20 20 20 66 75 6e 63  grep".#     func
5ad0: 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f 6f  _assert_exists_o
5ae0: 6e 5f 70 61 74 68 5f 74 32 20 22 75 6e 61 6d 65  n_path_t2 "uname
5af0: 22 20 20 23 20 74 6f 20 63 68 65 63 6b 20 74 68  "  # to check th
5b00: 65 20 4f 53 20 74 79 70 65 0a 23 2d 2d 2d 2d 2d  e OS type.#-----
5b10: 2d 2d 2d 0a 23 66 75 6e 63 5f 61 73 73 65 72 74  ---.#func_assert
5b20: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
5b30: 74 32 20 22 72 65 61 64 6c 69 6e 6b 22 0a 66 75  t2 "readlink".fu
5b40: 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73  nc_assert_exists
5b50: 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 72 75 62  _on_path_t2 "rub
5b60: 79 22 20 20 23 20 61 6e 79 74 68 69 6e 67 20 6f  y"  # anything o
5b70: 76 65 72 2f 65 71 75 61 6c 20 76 2e 32 2e 31 20  ver/equal v.2.1 
5b80: 77 69 6c 6c 20 70 72 6f 62 61 62 6c 79 20 64 6f  will probably do
5b90: 0a 23 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78  .#func_assert_ex
5ba0: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20  ists_on_path_t2 
5bb0: 22 73 70 6c 69 74 22 20 23 20 66 6f 72 20 63 75  "split" # for cu
5bc0: 74 74 69 6e 67 20 66 69 6c 65 73 0a 23 66 75 6e  tting files.#fun
5bd0: 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73 5f  c_assert_exists_
5be0: 6f 6e 5f 70 61 74 68 5f 74 32 20 22 74 65 73 74  on_path_t2 "test
5bf0: 22 0a 66 75 6e 63 5f 61 73 73 65 72 74 5f 65 78  ".func_assert_ex
5c00: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 32 20  ists_on_path_t2 
5c10: 22 75 75 69 64 67 65 6e 22 20 22 75 75 69 64 22  "uuidgen" "uuid"
5c20: 20 23 20 47 55 49 44 20 67 65 6e 65 72 61 74 69   # GUID generati
5c30: 6f 6e 20 6f 6e 20 4c 69 6e 75 78 20 61 6e 64 20  on on Linux and 
5c40: 42 53 44 0a 23 66 75 6e 63 5f 61 73 73 65 72 74  BSD.#func_assert
5c50: 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f  _exists_on_path_
5c60: 74 32 20 22 78 61 72 67 73 22 20 20 23 20 6e 6f  t2 "xargs"  # no
5c70: 74 20 69 6e 20 75 73 65 20 79 65 74 20 0a 66 75  t in use yet .fu
5c80: 6e 63 5f 61 73 73 65 72 74 5f 65 78 69 73 74 73  nc_assert_exists
5c90: 5f 6f 6e 5f 70 61 74 68 5f 74 32 20 22 77 63 22  _on_path_t2 "wc"
5ca0: 20 23 20 66 6f 72 20 63 68 65 63 6b 69 6e 67 20   # for checking 
5cb0: 68 61 73 68 20 6c 65 6e 67 74 68 73 20 20 20 0a  hash lengths   .
5cc0: 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .#--------------
5cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5ce0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5cf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
5d00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 23 20  ------------..# 
5d10: 49 66 20 74 68 65 20 53 5f 43 41 4e 44 49 44 41  If the S_CANDIDA
5d20: 54 45 20 69 73 20 61 20 70 6f 73 69 74 69 76 65  TE is a positive
5d30: 20 77 68 6f 6c 65 20 6e 75 6d 62 65 72 2c 20 69   whole number, i
5d40: 6e 63 6c 75 64 69 6e 67 20 30 20 61 6e 64 20 30  ncluding 0 and 0
5d50: 30 30 30 34 32 2c 20 0a 23 20 74 68 65 6e 20 69  00042, .# then i
5d60: 74 20 72 65 74 75 72 6e 73 20 74 68 65 20 70 6f  t returns the po
5d70: 73 69 74 69 76 65 20 77 68 6f 6c 65 20 6e 75 6d  sitive whole num
5d80: 62 65 72 20 69 6e 20 61 20 66 6f 72 6d 2c 20 77  ber in a form, w
5d90: 68 65 72 65 20 0a 23 20 74 68 65 20 6c 65 61 64  here .# the lead
5da0: 69 6e 67 20 7a 65 72 6f 73 20 68 61 76 65 20 62  ing zeros have b
5db0: 65 65 6e 20 72 65 6d 6f 76 65 64 2e 20 4f 74 68  een removed. Oth
5dc0: 65 72 77 69 73 65 20 69 74 20 72 65 74 75 72 6e  erwise it return
5dd0: 73 0a 23 20 61 6e 20 65 6d 70 74 79 20 73 74 72  s.# an empty str
5de0: 69 6e 67 2e 20 0a 23 0a 23 20 20 20 20 20 22 30  ing. .#.#     "0
5df0: 30 30 30 30 22 20 2d 3e 20 20 20 22 30 22 0a 23  0000" ->   "0".#
5e00: 20 20 20 20 22 2b 30 30 30 30 30 22 20 2d 3e 20      "+00000" -> 
5e10: 20 20 22 30 22 0a 23 20 20 20 20 22 2d 30 30 30    "0".#    "-000
5e20: 30 30 22 20 2d 3e 20 20 20 20 22 22 0a 23 20 20  00" ->    "".#  
5e30: 20 20 20 22 30 30 30 34 32 22 20 2d 3e 20 20 22     "00042" ->  "
5e40: 34 32 22 0a 23 20 20 20 20 22 2b 30 30 30 34 32  42".#    "+00042
5e50: 22 20 2d 3e 20 20 22 34 32 22 0a 23 20 20 20 20  " ->  "42".#    
5e60: 20 22 30 30 34 32 30 22 20 2d 3e 20 22 34 32 30   "00420" -> "420
5e70: 22 0a 23 20 20 20 20 20 20 20 22 34 32 30 22 20  ".#       "420" 
5e80: 2d 3e 20 22 34 32 30 22 0a 23 20 20 20 20 20 20  -> "420".#      
5e90: 20 22 2b 34 32 22 20 2d 3e 20 20 22 34 32 22 0a   "+42" ->  "42".
5ea0: 23 20 20 20 20 20 20 20 22 2d 34 32 22 20 2d 3e  #       "-42" ->
5eb0: 20 20 20 20 22 22 0a 23 20 20 20 20 20 20 20 20      "".#        
5ec0: 20 20 22 22 20 2d 3e 20 20 20 20 22 22 0a 23 20    "" ->    "".# 
5ed0: 20 20 20 20 20 20 20 20 22 20 22 20 2d 3e 20 20          " " ->  
5ee0: 20 20 22 22 0a 23 20 20 20 20 20 20 20 22 34 2e    "".#       "4.
5ef0: 32 22 20 2d 3e 20 20 20 20 22 22 0a 23 20 20 20  2" ->    "".#   
5f00: 20 20 22 61 20 20 62 63 22 20 2d 3e 20 20 20 20    "a  bc" ->    
5f10: 22 22 0a 23 0a 23 20 41 20 6d 6f 72 65 20 64 65  "".#.# A more de
5f20: 74 61 69 6c 65 64 20 6c 69 73 74 20 6f 66 20 74  tailed list of t
5f30: 68 65 20 63 6f 6e 76 65 72 73 69 6f 6e 20 63 61  he conversion ca
5f40: 73 65 73 20 61 72 65 20 64 65 73 63 72 69 62 65  ses are describe
5f50: 64 20 61 74 20 74 68 65 0a 23 20 0a 23 20 20 20  d at the.# .#   
5f60: 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f    func_mmmv_x_po
5f70: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
5f80: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
5f90: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
5fa0: 74 32 28 29 0a 23 0a 53 5f 46 55 4e 43 5f 4d 4d  t2().#.S_FUNC_MM
5fb0: 4d 56 5f 58 5f 50 4f 53 49 54 49 56 45 5f 57 48  MV_X_POSITIVE_WH
5fc0: 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f 52 5f 41 4e  OLE_NUMBER_OR_AN
5fd0: 5f 45 4d 50 54 59 53 54 52 49 4e 47 5f 54 31 5f  _EMPTYSTRING_T1_
5fe0: 4f 55 54 3d 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  OUT="".func_mmmv
5ff0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
6000: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
6010: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 28 29 20  mptystring_t1() 
6020: 7b 20 23 20 53 5f 43 41 4e 44 49 44 41 54 45 0a  { # S_CANDIDATE.
6030: 20 20 20 20 6c 6f 63 61 6c 20 53 5f 43 41 4e 44      local S_CAND
6040: 49 44 41 54 45 3d 22 24 31 22 20 23 20 54 4f 44  IDATE="$1" # TOD
6050: 4f 3a 20 66 69 78 20 69 74 20 74 6f 20 68 61 6e  O: fix it to han
6060: 64 6c 65 20 61 20 63 61 73 65 2c 20 77 68 65 72  dle a case, wher
6070: 65 20 74 68 65 20 0a 20 20 20 20 20 20 20 20 20  e the .         
6080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
6090: 20 20 23 20 20 20 20 20 20 20 53 5f 43 41 4e 44    #       S_CAND
60a0: 49 44 41 54 45 20 63 6f 6e 74 61 69 6e 73 20 73  IDATE contains s
60b0: 70 61 63 65 73 2e 0a 20 20 20 20 23 2d 2d 2d 2d  paces..    #----
60c0: 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ----.    local S
60d0: 5f 54 4d 50 5f 30 3d 22 22 20 23 20 64 65 63 6c  _TMP_0="" # decl
60e0: 61 72 61 74 69 6f 6e 0a 20 20 20 20 6c 6f 63 61  aration.    loca
60f0: 6c 20 53 5f 54 4d 50 5f 31 3d 22 22 20 23 20 64  l S_TMP_1="" # d
6100: 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 53  eclaration.    S
6110: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58 5f 50 4f 53  _FUNC_MMMV_X_POS
6120: 49 54 49 56 45 5f 57 48 4f 4c 45 5f 4e 55 4d 42  ITIVE_WHOLE_NUMB
6130: 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50 54 59 53 54  ER_OR_AN_EMPTYST
6140: 52 49 4e 47 5f 54 31 5f 4f 55 54 3d 22 22 0a 20  RING_T1_OUT="". 
6150: 20 20 20 6c 6f 63 61 6c 20 53 42 5f 46 41 49 4c     local SB_FAIL
6160: 45 44 3d 27 66 27 0a 20 20 20 20 23 2d 2d 2d 2d  ED='f'.    #----
6170: 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24  ----.    if [ "$
6180: 53 5f 43 41 4e 44 49 44 41 54 45 22 20 3d 3d 20  S_CANDIDATE" == 
6190: 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
61a0: 20 20 20 53 42 5f 46 41 49 4c 45 44 3d 22 74 22     SB_FAILED="t"
61b0: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
61c0: 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22  -----.    if [ "
61d0: 24 53 42 5f 46 41 49 4c 45 44 22 20 3d 3d 20 22  $SB_FAILED" == "
61e0: 66 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  f" ]; then.     
61f0: 20 20 20 23 20 54 68 69 73 20 69 73 20 61 20 62     # This is a b
6200: 75 67 66 69 78 2f 77 6f 72 6b 61 72 6f 6e 64 20  ugfix/workarond 
6210: 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 68 61  that does not ha
6220: 76 65 20 61 6c 6d 6f 73 74 20 61 6e 79 74 68 69  ve almost anythi
6230: 6e 67 20 0a 20 20 20 20 20 20 20 20 23 20 74 6f  ng .        # to
6240: 20 64 6f 20 77 69 74 68 20 74 68 65 20 61 6c 67   do with the alg
6250: 6f 72 69 74 68 6d 20 69 74 73 65 6c 66 2c 20 62  orithm itself, b
6260: 75 74 20 69 74 20 65 78 69 73 74 73 20 6f 6e 6c  ut it exists onl
6270: 79 20 74 6f 20 63 6f 70 65 20 77 69 74 68 20 0a  y to cope with .
6280: 20 20 20 20 20 20 20 20 23 20 77 69 74 68 20 74          # with t
6290: 68 65 20 52 75 62 79 20 6d 61 63 72 6f 20 6c 69  he Ruby macro li
62a0: 6e 65 2e 0a 20 20 20 20 20 20 20 20 23 20 62 6c  ne..        # bl
62b0: 61 62 6c 61 3d 22 60 72 75 62 79 20 2d 65 20 5c  abla="`ruby -e \
62c0: 22 70 72 69 6e 74 28 27 24 53 5f 43 41 4e 44 49  "print('$S_CANDI
62d0: 44 41 54 45 27 2e 74 6f 5f 73 2e 20 62 6c 61 62  DATE'.to_s. blab
62e0: 6c 61 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50  la.        S_TMP
62f0: 5f 30 3d 22 60 65 63 68 6f 20 5c 22 24 53 5f 43  _0="`echo \"$S_C
6300: 41 4e 44 49 44 41 54 45 5c 22 20 7c 20 72 75 62  ANDIDATE\" | rub
6310: 79 20 2d 65 20 5c 22 78 3d 72 65 61 64 6c 69 6e  y -e \"x=readlin
6320: 65 3b 20 70 72 69 6e 74 28 78 2e 74 6f 5f 73 2e  e; print(x.to_s.
6330: 67 73 75 62 28 2f 5b 5c 5c 5c 22 5c 27 5c 5c 73  gsub(/[\\\"\'\\s
6340: 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20  ]+/,''));\" `". 
6350: 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f         if [ "$S_
6360: 54 4d 50 5f 30 22 20 21 3d 20 22 24 53 5f 43 41  TMP_0" != "$S_CA
6370: 4e 44 49 44 41 54 45 22 20 5d 3b 20 74 68 65 6e  NDIDATE" ]; then
6380: 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 42 5f  .            SB_
6390: 46 41 49 4c 45 44 3d 22 74 22 0a 20 20 20 20 20  FAILED="t".     
63a0: 20 20 20 66 69 20 0a 20 20 20 20 66 69 0a 20 20     fi .    fi.  
63b0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
63c0: 69 66 20 5b 20 22 24 53 42 5f 46 41 49 4c 45 44  if [ "$SB_FAILED
63d0: 22 20 3d 3d 20 22 66 22 20 5d 3b 20 74 68 65 6e  " == "f" ]; then
63e0: 0a 20 20 20 20 20 20 20 20 23 20 54 4f 44 4f 3a  .        # TODO:
63f0: 20 54 68 65 20 6e 65 78 74 20 6c 69 6e 65 20 69   The next line i
6400: 73 20 74 68 65 20 66 75 6e 6e 79 20 6f 6e 65 20  s the funny one 
6410: 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 6d 61  that does not ma
6420: 6b 65 20 73 65 6e 73 65 2c 20 62 75 74 20 69 74  ke sense, but it
6430: 20 64 6f 63 75 6d 65 6e 74 73 20 74 68 65 20 73   documents the s
6440: 69 74 75 61 74 69 6f 6e 2e 0a 20 20 20 20 20 20  ituation..      
6450: 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79    S_TMP_0="`ruby
6460: 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53 5f   -e \"print('$S_
6470: 43 41 4e 44 49 44 41 54 45 27 2e 74 6f 5f 73 2e  CANDIDATE'.to_s.
6480: 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c 27 27 29  gsub(/[\s]+/,'')
6490: 29 3b 5c 22 20 60 22 0a 20 20 20 20 20 20 20 20  );\" `".        
64a0: 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20  if [ "$S_TMP_0" 
64b0: 21 3d 20 22 24 53 5f 43 41 4e 44 49 44 41 54 45  != "$S_CANDIDATE
64c0: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
64d0: 20 20 20 20 20 20 53 42 5f 46 41 49 4c 45 44 3d        SB_FAILED=
64e0: 22 74 22 0a 20 20 20 20 20 20 20 20 66 69 20 0a  "t".        fi .
64f0: 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
6500: 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24  ----.    if [ "$
6510: 53 42 5f 46 41 49 4c 45 44 22 20 3d 3d 20 22 66  SB_FAILED" == "f
6520: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
6530: 20 20 23 20 43 6f 76 65 72 73 20 63 61 73 65 73    # Covers cases
6540: 20 6c 69 6b 65 20 22 2b 22 2c 22 2b 2b 34 32 22   like "+","++42"
6550: 2c 22 2b 2b 2b 2b 2b 2b 34 32 22 2c 22 2d 34 32  ,"++++++42","-42
6560: 22 2c 22 34 61 62 32 22 2c 22 34 2c 32 22 2c 22  ","4ab2","4,2","
6570: 34 2e 32 22 2c 22 34 32 2e 22 2c 22 34 32 2d 22  4.2","42.","42-"
6580: 2c 22 34 32 2b 22 2c 22 34 2b 32 22 0a 20 20 20  ,"42+","4+2".   
6590: 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72       S_TMP_0="`r
65a0: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27  uby -e \"print('
65b0: 24 53 5f 43 41 4e 44 49 44 41 54 45 27 2e 74 6f  $S_CANDIDATE'.to
65c0: 5f 73 2e 67 73 75 62 28 2f 5e 5b 2b 5d 2f 2c 27  _s.gsub(/^[+]/,'
65d0: 27 29 29 3b 5c 22 20 60 22 0a 20 20 20 20 20 20  '));\" `".      
65e0: 20 20 23 20 41 74 20 74 68 65 20 70 72 65 76 69    # At the previ
65f0: 6f 75 73 20 6c 69 6e 65 3a 20 22 2b 22 20 2d 3e  ous line: "+" ->
6600: 20 22 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b   "".        if [
6610: 20 22 24 53 5f 54 4d 50 5f 30 22 20 3d 3d 20 22   "$S_TMP_0" == "
6620: 22 20 5d 3b 20 74 68 65 6e 20 20 0a 20 20 20 20  " ]; then  .    
6630: 20 20 20 20 20 20 20 20 23 20 22 24 53 5f 43 41          # "$S_CA
6640: 4e 44 49 44 41 54 45 22 20 3d 3d 20 22 2b 22 0a  NDIDATE" == "+".
6650: 20 20 20 20 20 20 20 20 20 20 20 20 53 42 5f 46              SB_F
6660: 41 49 4c 45 44 3d 22 74 22 0a 20 20 20 20 20 20  AILED="t".      
6670: 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20    else.         
6680: 20 20 20 53 5f 54 4d 50 5f 31 3d 22 60 72 75 62     S_TMP_1="`rub
6690: 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 27 24 53  y -e \"print('$S
66a0: 5f 54 4d 50 5f 30 27 2e 74 6f 5f 73 2e 67 73 75  _TMP_0'.to_s.gsu
66b0: 62 28 2f 5b 5c 64 5d 2b 2f 2c 27 27 29 29 3b 5c  b(/[\d]+/,''));\
66c0: 22 20 60 22 0a 20 20 20 20 20 20 20 20 20 20 20  " `".           
66d0: 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22   if [ "$S_TMP_1"
66e0: 20 21 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20   != "" ]; then. 
66f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53                 S
6700: 42 5f 46 41 49 4c 45 44 3d 22 74 22 0a 20 20 20  B_FAILED="t".   
6710: 20 20 20 20 20 20 20 20 20 66 69 20 0a 20 20 20           fi .   
6720: 20 20 20 20 20 66 69 20 0a 20 20 20 20 66 69 0a       fi .    fi.
6730: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
6740: 20 20 69 66 20 5b 20 22 24 53 42 5f 46 41 49 4c    if [ "$SB_FAIL
6750: 45 44 22 20 3d 3d 20 22 66 22 20 5d 3b 20 74 68  ED" == "f" ]; th
6760: 65 6e 0a 20 20 20 20 20 20 20 20 23 20 41 74 20  en.        # At 
6770: 74 68 69 73 20 6c 69 6e 65 20 74 68 65 20 53 5f  this line the S_
6780: 43 41 4e 44 49 44 41 54 45 20 69 73 20 76 61 6c  CANDIDATE is val
6790: 69 64 2c 20 62 75 74 20 69 74 20 6d 61 79 20 20  id, but it may  
67a0: 68 61 76 65 20 0a 20 20 20 20 20 20 20 20 23 20  have .        # 
67b0: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f  the following fo
67c0: 72 6d 73 3a 20 0a 20 20 20 20 20 20 20 20 23 0a  rms: .        #.
67d0: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 22 30          #     "0
67e0: 22 2c 22 2b 30 22 2c 22 2b 30 30 30 30 22 2c 22  ","+0","+0000","
67f0: 2b 30 30 34 32 22 2c 22 2b 34 32 30 22 2c 22 30  +0042","+420","0
6800: 30 30 30 22 2c 22 34 32 22 2c 22 30 30 34 32 22  000","42","0042"
6810: 0a 20 20 20 20 20 20 20 20 23 0a 20 20 20 20 20  .        #.     
6820: 20 20 20 23 20 41 74 20 74 68 69 73 20 6c 69 6e     # At this lin
6830: 65 20 74 68 65 20 53 5f 54 4d 50 5f 30 20 0a 20  e the S_TMP_0 . 
6840: 20 20 20 20 20 20 20 23 0a 20 20 20 20 20 20 20         #.       
6850: 20 23 20 20 20 20 20 22 24 53 5f 43 41 4e 44 49   #     "$S_CANDI
6860: 44 41 54 45 22 20 2d 3e 20 22 24 53 5f 54 4d 50  DATE" -> "$S_TMP
6870: 5f 30 22 0a 20 20 20 20 20 20 20 20 23 0a 20 20  _0".        #.  
6880: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20        #         
6890: 20 20 22 2b 30 30 30 34 32 22 20 2d 3e 20 22 30    "+00042" -> "0
68a0: 30 30 34 32 22 0a 20 20 20 20 20 20 20 20 23 20  0042".        # 
68b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 2b                "+
68c0: 30 22 20 2d 3e 20 20 20 20 20 22 30 22 0a 20 20  0" ->     "0".  
68d0: 20 20 20 20 20 20 23 0a 20 20 20 20 20 20 20 20        #.        
68e0: 23 20 61 74 20 6f 6e 65 20 6f 66 20 74 68 65 20  # at one of the 
68f0: 70 72 65 76 69 6f 75 73 20 69 66 2d 62 6c 6f 63  previous if-bloc
6900: 6b 73 2e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d  ks..        S_TM
6910: 50 5f 31 3d 22 60 72 75 62 79 20 2d 65 20 5c 22  P_1="`ruby -e \"
6920: 70 72 69 6e 74 28 27 24 53 5f 54 4d 50 5f 30 27  print('$S_TMP_0'
6930: 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5e 5b 30 5d  .to_s.gsub(/^[0]
6940: 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20 20  +/,''));\" `".  
6950: 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54        if [ "$S_T
6960: 4d 50 5f 31 22 20 3d 3d 20 22 22 20 5d 3b 20 74  MP_1" == "" ]; t
6970: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
6980: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58 5f 50 4f  S_FUNC_MMMV_X_PO
6990: 53 49 54 49 56 45 5f 57 48 4f 4c 45 5f 4e 55 4d  SITIVE_WHOLE_NUM
69a0: 42 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50 54 59 53  BER_OR_AN_EMPTYS
69b0: 54 52 49 4e 47 5f 54 31 5f 4f 55 54 3d 22 30 22  TRING_T1_OUT="0"
69c0: 0a 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20  .        else.  
69d0: 20 20 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43            S_FUNC
69e0: 5f 4d 4d 4d 56 5f 58 5f 50 4f 53 49 54 49 56 45  _MMMV_X_POSITIVE
69f0: 5f 57 48 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f 52  _WHOLE_NUMBER_OR
6a00: 5f 41 4e 5f 45 4d 50 54 59 53 54 52 49 4e 47 5f  _AN_EMPTYSTRING_
6a10: 54 31 5f 4f 55 54 3d 22 24 53 5f 54 4d 50 5f 31  T1_OUT="$S_TMP_1
6a20: 22 0a 20 20 20 20 20 20 20 20 66 69 20 0a 20 20  ".        fi .  
6a30: 20 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d    fi.} # func_mm
6a40: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
6a50: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
6a60: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 0a  _emptystring_t1.
6a70: 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ..func_mmmv_x_po
6a80: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
6a90: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
6aa0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
6ab0: 74 31 28 29 20 7b 20 23 20 53 5f 49 4e 20 53 5f  t1() { # S_IN S_
6ac0: 45 58 50 45 43 54 45 44 0a 20 20 20 20 6c 6f 63  EXPECTED.    loc
6ad0: 61 6c 20 53 5f 49 4e 3d 22 24 31 22 0a 20 20 20  al S_IN="$1".   
6ae0: 20 6c 6f 63 61 6c 20 53 5f 45 58 50 45 43 54 45   local S_EXPECTE
6af0: 44 3d 22 24 32 22 0a 20 20 20 20 23 2d 2d 2d 2d  D="$2".    #----
6b00: 2d 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d  ----.    func_mm
6b10: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
6b20: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
6b30: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 20  _emptystring_t1 
6b40: 22 24 53 5f 49 4e 22 0a 20 20 20 20 6c 6f 63 61  "$S_IN".    loca
6b50: 6c 20 53 5f 46 55 4e 43 3d 22 24 53 5f 46 55 4e  l S_FUNC="$S_FUN
6b60: 43 5f 4d 4d 4d 56 5f 58 5f 50 4f 53 49 54 49 56  C_MMMV_X_POSITIV
6b70: 45 5f 57 48 4f 4c 45 5f 4e 55 4d 42 45 52 5f 4f  E_WHOLE_NUMBER_O
6b80: 52 5f 41 4e 5f 45 4d 50 54 59 53 54 52 49 4e 47  R_AN_EMPTYSTRING
6b90: 5f 54 31 5f 4f 55 54 22 0a 20 20 20 20 69 66 20  _T1_OUT".    if 
6ba0: 5b 20 22 24 53 5f 46 55 4e 43 22 20 21 3d 20 22  [ "$S_FUNC" != "
6bb0: 24 53 5f 45 58 50 45 43 54 45 44 22 20 5d 3b 20  $S_EXPECTED" ]; 
6bc0: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
6bd0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
6be0: 6f 20 22 41 20 74 65 73 74 20 6f 66 20 74 68 65  o "A test of the
6bf0: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73   func_mmmv_x_pos
6c00: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
6c10: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
6c20: 72 69 6e 67 5f 74 31 20 66 61 69 6c 65 64 2e 22  ring_t1 failed."
6c30: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
6c40: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
6c50: 20 20 20 53 5f 49 4e 3d 24 53 5f 49 4e 22 0a 20     S_IN=$S_IN". 
6c60: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
6c70: 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
6c80: 20 53 5f 46 55 4e 43 3d 24 53 5f 46 55 4e 43 22   S_FUNC=$S_FUNC"
6c90: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
6ca0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
6cb0: 20 20 20 53 5f 45 58 50 45 43 54 45 44 3d 24 53     S_EXPECTED=$S
6cc0: 5f 45 58 50 45 43 54 45 44 22 0a 20 20 20 20 20  _EXPECTED".     
6cd0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
6ce0: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
6cf0: 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
6d00: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
6d10: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
6d20: 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f      fi.} # func_
6d30: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
6d40: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
6d50: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
6d60: 31 5f 74 65 73 74 65 72 5f 74 31 0a 0a 0a 66 75  1_tester_t1...fu
6d70: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
6d80: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
6d90: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
6da0: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 32 28 29  g_t1_tester_t2()
6db0: 20 7b 20 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   { .#-----------
6dc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6dd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
6de0: 52 45 4e 45 53 53 41 41 54 4f 52 5f 42 4c 4f 43  RENESSAATOR_BLOC
6df0: 4b 5f 53 54 41 52 54 0a 23 20 52 45 4e 45 53 53  K_START.# RENESS
6e00: 41 41 54 4f 52 5f 42 4c 4f 43 4b 5f 49 44 3d 62  AATOR_BLOCK_ID=b
6e10: 6c 6f 63 6b 5f 30 34 35 32 37 35 37 61 2d 32 62  lock_0452757a-2b
6e20: 36 66 2d 34 32 37 35 2d 62 63 35 32 2d 36 33 32  6f-4275-bc52-632
6e30: 30 33 30 35 30 32 31 65 37 5f 63 69 74 79 0a 23  0305021e7_city.#
6e40: 20 52 45 4e 45 53 53 41 41 54 4f 52 5f 53 4f 55   RENESSAATOR_SOU
6e50: 52 43 45 5f 4c 41 4e 47 55 41 47 45 3d 52 75 62  RCE_LANGUAGE=Rub
6e60: 79 0a 23 20 52 45 4e 45 53 53 41 41 54 4f 52 5f  y.# RENESSAATOR_
6e70: 53 4f 55 52 43 45 5f 53 54 41 52 54 0a 23 20 23  SOURCE_START.# #
6e80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
6e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 61 72  -----------.# ar
6ea0: 3d 41 72 72 61 79 2e 6e 65 77 20 20 23 20 65 6c  =Array.new  # el
6eb0: 65 6d 65 6e 74 73 20 61 72 65 20 61 72 72 61 79  ements are array
6ec0: 73 3a 20 5b 73 5f 69 6e 2c 20 73 5f 65 78 70 65  s: [s_in, s_expe
6ed0: 63 74 65 64 5d 0a 23 20 61 72 3c 3c 5b 22 30 30  cted].# ar<<["00
6ee0: 30 30 30 22 2c 22 30 22 5d 0a 23 20 61 72 3c 3c  000","0"].# ar<<
6ef0: 5b 22 2b 30 30 30 30 2e 30 22 2c 22 22 5d 0a 23  ["+0000.0",""].#
6f00: 20 61 72 3c 3c 5b 22 2b 30 30 30 30 30 22 2c 22   ar<<["+00000","
6f10: 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30 22 2c  0"].# ar<<["+0",
6f20: 22 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 22 2c  "0"].# ar<<["0",
6f30: 22 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 2b 22  "0"].# ar<<["0+"
6f40: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30 30  ,""].# ar<<["+00
6f50: 30 30 2c 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  00,0",""].# ar<<
6f60: 5b 22 2d 30 30 30 30 30 22 2c 22 22 5d 0a 23 20  ["-00000",""].# 
6f70: 61 72 3c 3c 5b 22 2d 30 30 30 30 2c 30 22 2c 22  ar<<["-0000,0","
6f80: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 30 30 30 30  "].# ar<<["-0000
6f90: 2e 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  .0",""].# ar<<["
6fa0: 2d 30 30 30 30 30 2d 22 2c 22 22 5d 0a 23 20 61  -00000-",""].# a
6fb0: 72 3c 3c 5b 22 30 30 30 30 30 2d 22 2c 22 22 5d  r<<["00000-",""]
6fc0: 0a 23 20 61 72 3c 3c 5b 22 30 30 30 30 30 20 22  .# ar<<["00000 "
6fd0: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 20 30 30  ,""].# ar<<[" 00
6fe0: 30 30 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  000",""].# ar<<[
6ff0: 22 2d 2d 30 30 30 30 30 22 2c 22 22 5d 0a 23 20  "--00000",""].# 
7000: 61 72 3c 3c 5b 22 2b 2b 30 30 30 30 30 22 2c 22  ar<<["++00000","
7010: 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 30 30 2d 30  "].# ar<<["000-0
7020: 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d  0",""].# ar<<["-
7030: 30 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30  0",""].# ar<<["0
7040: 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30  -",""].# ar<<["0
7050: 30 30 30 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  000-",""].# ar<<
7060: 5b 22 2b 30 30 30 30 2d 22 2c 22 22 5d 0a 23 20  ["+0000-",""].# 
7070: 61 72 3c 3c 5b 22 2d 30 30 30 30 2d 22 2c 22 22  ar<<["-0000-",""
7080: 5d 0a 23 20 61 72 3c 3c 5b 22 2d 30 30 30 30 2b  ].# ar<<["-0000+
7090: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 30  ",""].# ar<<["00
70a0: 30 30 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  00+",""].# ar<<[
70b0: 22 30 30 30 2b 30 30 22 2c 22 22 5d 0a 23 20 61  "000+00",""].# a
70c0: 72 3c 3c 5b 22 30 30 30 34 32 22 2c 22 34 32 22  r<<["00042","42"
70d0: 5d 0a 23 20 61 72 3c 3c 5b 22 2b 30 30 30 34 32  ].# ar<<["+00042
70e0: 22 2c 22 34 32 22 5d 0a 23 20 61 72 3c 3c 5b 22  ","42"].# ar<<["
70f0: 30 30 34 32 30 22 2c 22 34 32 30 22 5d 0a 23 20  00420","420"].# 
7100: 61 72 3c 3c 5b 22 2b 30 30 34 32 30 22 2c 22 34  ar<<["+00420","4
7110: 32 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 30 34  20"].# ar<<["004
7120: 32 30 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  20+",""].# ar<<[
7130: 22 30 30 34 2b 32 30 22 2c 22 22 5d 0a 23 20 61  "004+20",""].# a
7140: 72 3c 3c 5b 22 34 32 30 22 2c 22 34 32 30 22 5d  r<<["420","420"]
7150: 0a 23 20 61 72 3c 3c 5b 22 2b 34 32 30 22 2c 22  .# ar<<["+420","
7160: 34 32 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32  420"].# ar<<["42
7170: 30 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  0+",""].# ar<<["
7180: 31 22 2c 22 31 22 5d 0a 23 20 61 72 3c 3c 5b 22  1","1"].# ar<<["
7190: 2d 31 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  -1",""].# ar<<["
71a0: 31 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  1-",""].# ar<<["
71b0: 2b 31 22 2c 22 31 22 5d 0a 23 20 61 72 3c 3c 5b  +1","1"].# ar<<[
71c0: 22 39 22 2c 22 39 22 5d 0a 23 20 61 72 3c 3c 5b  "9","9"].# ar<<[
71d0: 22 2b 39 22 2c 22 39 22 5d 0a 23 20 61 72 3c 3c  "+9","9"].# ar<<
71e0: 5b 22 39 30 30 30 22 2c 22 39 30 30 30 22 5d 0a  ["9000","9000"].
71f0: 23 20 61 72 3c 3c 5b 22 30 39 30 30 30 22 2c 22  # ar<<["09000","
7200: 39 30 30 30 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b  9000"].# ar<<["+
7210: 30 39 30 30 30 22 2c 22 39 30 30 30 22 5d 0a 23  09000","9000"].#
7220: 20 61 72 3c 3c 5b 22 2b 2b 30 39 30 30 30 22 2c   ar<<["++09000",
7230: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 30 39 30 30  ""].# ar<<["0900
7240: 30 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  0+",""].# ar<<["
7250: 30 39 30 30 30 2d 22 2c 22 22 5d 0a 23 20 61 72  09000-",""].# ar
7260: 3c 3c 5b 22 30 39 30 30 30 2d 2d 22 2c 22 22 5d  <<["09000--",""]
7270: 0a 23 20 61 72 3c 3c 5b 22 2d 39 22 2c 22 22 5d  .# ar<<["-9",""]
7280: 0a 23 20 61 72 3c 3c 5b 22 2b 2b 39 22 2c 22 22  .# ar<<["++9",""
7290: 5d 0a 23 20 61 72 3c 3c 5b 22 39 2b 22 2c 22 22  ].# ar<<["9+",""
72a0: 5d 0a 23 20 61 72 3c 3c 5b 22 39 2b 2b 22 2c 22  ].# ar<<["9++","
72b0: 22 5d 0a 23 20 61 72 3c 3c 5b 22 39 2b 2d 22 2c  "].# ar<<["9+-",
72c0: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2d 39 22  ""].# ar<<["+-9"
72d0: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 22  ,""].# ar<<["42"
72e0: 2c 22 34 32 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b  ,"42"].# ar<<["+
72f0: 34 32 22 2c 22 34 32 22 5d 0a 23 20 61 72 3c 3c  42","42"].# ar<<
7300: 5b 22 2b 2b 34 32 22 2c 22 22 5d 0a 23 20 61 72  ["++42",""].# ar
7310: 3c 3c 5b 22 2b 34 32 20 22 2c 22 22 5d 0a 23 20  <<["+42 ",""].# 
7320: 61 72 3c 3c 5b 22 2b 34 20 32 22 2c 22 22 5d 0a  ar<<["+4 2",""].
7330: 23 20 61 72 3c 3c 5b 22 20 2b 34 20 32 22 2c 22  # ar<<[" +4 2","
7340: 22 5d 0a 23 20 61 72 3c 3c 5b 22 20 2b 34 32 22  "].# ar<<[" +42"
7350: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 34 32  ,""].# ar<<["-42
7360: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 20 2d  ",""].# ar<<[" -
7370: 34 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  42",""].# ar<<["
7380: 20 2d 34 32 20 22 2c 22 22 5d 0a 23 20 61 72 3c   -42 ",""].# ar<
7390: 3c 5b 22 2d 2d 34 32 22 2c 22 22 5d 0a 23 20 61  <["--42",""].# a
73a0: 72 3c 3c 5b 22 2d 2d 2d 2d 34 32 22 2c 22 22 5d  r<<["----42",""]
73b0: 0a 23 20 61 72 3c 3c 5b 22 2b 34 32 2d 2d 2d 22  .# ar<<["+42---"
73c0: 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 34 2d  ,""].# ar<<["-4-
73d0: 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d  2",""].# ar<<["-
73e0: 34 2d 32 2d 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  4-2-",""].# ar<<
73f0: 5b 22 34 2d 32 2d 22 2c 22 22 5d 0a 23 20 61 72  ["4-2-",""].# ar
7400: 3c 3c 5b 22 34 32 2d 22 2c 22 22 5d 0a 23 20 61  <<["42-",""].# a
7410: 72 3c 3c 5b 22 34 32 2d 2d 2d 22 2c 22 22 5d 0a  r<<["42---",""].
7420: 23 20 61 72 3c 3c 5b 22 2b 34 2b 32 22 2c 22 22  # ar<<["+4+2",""
7430: 5d 0a 23 20 61 72 3c 3c 5b 22 34 2b 32 22 2c 22  ].# ar<<["4+2","
7440: 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 2b 22 2c  "].# ar<<["42+",
7450: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 2b 2b  ""].# ar<<["42++
7460: 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b  +",""].# ar<<["+
7470: 34 32 2b 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  42+",""].# ar<<[
7480: 22 34 2e 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c  "4.2",""].# ar<<
7490: 5b 22 34 2c 32 22 2c 22 22 5d 0a 23 20 61 72 3c  ["4,2",""].# ar<
74a0: 3c 5b 22 34 20 32 22 2c 22 22 5d 0a 23 20 61 72  <["4 2",""].# ar
74b0: 3c 3c 5b 22 34 20 2b 32 22 2c 22 22 5d 0a 23 20  <<["4 +2",""].# 
74c0: 61 72 3c 3c 5b 22 34 20 32 2b 22 2c 22 22 5d 0a  ar<<["4 2+",""].
74d0: 23 20 61 72 3c 3c 5b 22 34 32 20 22 2c 22 22 5d  # ar<<["42 ",""]
74e0: 0a 23 20 61 72 3c 3c 5b 22 34 32 2e 22 2c 22 22  .# ar<<["42.",""
74f0: 5d 0a 23 20 61 72 3c 3c 5b 22 34 32 2c 22 2c 22  ].# ar<<["42,","
7500: 22 5d 0a 23 20 61 72 3c 3c 5b 22 61 20 20 62 63  "].# ar<<["a  bc
7510: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 22 2c  ",""].# ar<<["",
7520: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 22 2c 22  ""].# ar<<["+","
7530: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2b 22 2c 22  "].# ar<<["++","
7540: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2b 2b 22 2c  "].# ar<<["+++",
7550: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 22 2c 22  ""].# ar<<["-","
7560: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 2d 22 2c 22  "].# ar<<["--","
7570: 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 2d 2d 22 2c  "].# ar<<["---",
7580: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2d 2b 22 2c  ""].# ar<<["-+",
7590: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2d 22 2c  ""].# ar<<["+-",
75a0: 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 2b 2d 2d 2d  ""].# ar<<["+---
75b0: 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 5c 5c  ",""].# ar<<["\\
75c0: 5c 22 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  \"",""].# ar<<["
75d0: 27 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22 27  '",""].# ar<<["'
75e0: 34 32 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  42",""].# ar<<["
75f0: 34 32 27 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b  42'",""].# ar<<[
7600: 22 20 22 2c 22 22 5d 0a 23 20 61 72 3c 3c 5b 22  " ",""].# ar<<["
7610: 20 20 20 22 2c 22 22 5d 0a 23 20 23 2d 2d 2d 2d     ",""].# #----
7620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7630: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 68 74 3d 48 61 73  -------.# ht=Has
7640: 68 2e 6e 65 77 0a 23 20 61 72 2e 65 61 63 68 20  h.new.# ar.each 
7650: 64 6f 20 7c 61 72 5f 30 7c 0a 23 20 78 5f 30 3d  do |ar_0|.# x_0=
7660: 61 72 5f 30 5b 30 5d 0a 23 20 69 66 20 68 74 2e  ar_0[0].# if ht.
7670: 68 61 73 5f 6b 65 79 3f 20 78 5f 30 0a 23 20 72  has_key? x_0.# r
7680: 61 69 73 65 20 45 78 63 65 70 74 69 6f 6e 2e 6e  aise Exception.n
7690: 65 77 28 22 5c 6e 44 75 70 6c 69 63 61 74 65 3a  ew("\nDuplicate:
76a0: 5b 22 2b 78 5f 30 2e 74 6f 5f 73 2b 22 5d 5c 6e  ["+x_0.to_s+"]\n
76b0: 22 29 0a 23 20 65 6c 73 65 0a 23 20 68 74 5b 78  ").# else.# ht[x
76c0: 5f 30 5d 3d 34 32 0a 23 20 65 6e 64 20 23 20 69  _0]=42.# end # i
76d0: 66 0a 23 20 65 6e 64 20 23 20 6c 6f 6f 70 0a 23  f.# end # loop.#
76e0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 73 5f 74   #--------.# s_t
76f0: 65 73 74 5f 66 75 6e 63 5f 6e 61 6d 65 3d 22 66  est_func_name="f
7700: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
7710: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
7720: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
7730: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 22  ng_t1_tester_t1"
7740: 0a 23 20 73 5f 6c 63 5f 30 3d 73 5f 74 65 73 74  .# s_lc_0=s_test
7750: 5f 66 75 6e 63 5f 6e 61 6d 65 2b 22 20 20 5c 22  _func_name+"  \"
7760: 22 0a 23 20 73 5f 6c 63 5f 31 3d 22 5c 22 20 20  ".# s_lc_1="\"  
7770: 5c 22 22 0a 23 20 73 5f 6c 63 5f 32 3d 22 5c 22  \"".# s_lc_2="\"
7780: 22 0a 23 20 66 75 6e 63 5f 77 72 69 74 65 5f 74  ".# func_write_t
7790: 65 73 74 3d 6c 61 6d 62 64 61 20 64 6f 20 7c 73  est=lambda do |s
77a0: 5f 69 6e 2c 73 5f 65 78 70 65 63 74 65 64 7c 0a  _in,s_expected|.
77b0: 23 20 70 75 74 73 28 73 5f 6c 63 5f 30 2b 73 5f  # puts(s_lc_0+s_
77c0: 69 6e 2b 73 5f 6c 63 5f 31 2b 73 5f 65 78 70 65  in+s_lc_1+s_expe
77d0: 63 74 65 64 2b 73 5f 6c 63 5f 32 2b 22 5c 6e 22  cted+s_lc_2+"\n"
77e0: 29 0a 23 20 65 6e 64 20 23 20 66 75 6e 63 5f 77  ).# end # func_w
77f0: 72 69 74 65 5f 74 65 73 74 0a 23 20 61 72 2e 65  rite_test.# ar.e
7800: 61 63 68 7b 7c 61 72 5f 30 7c 20 66 75 6e 63 5f  ach{|ar_0| func_
7810: 77 72 69 74 65 5f 74 65 73 74 2e 63 61 6c 6c 28  write_test.call(
7820: 61 72 5f 30 5b 30 5d 2c 61 72 5f 30 5b 31 5d 29  ar_0[0],ar_0[1])
7830: 7d 0a 23 20 52 45 4e 45 53 53 41 41 54 4f 52 5f  }.# RENESSAATOR_
7840: 53 4f 55 52 43 45 5f 45 4e 44 0a 23 20 0a 23 20  SOURCE_END.# .# 
7850: 52 45 4e 45 53 53 41 41 54 4f 52 5f 41 55 54 4f  RENESSAATOR_AUTO
7860: 47 45 4e 45 52 41 54 45 44 5f 54 45 58 54 5f 53  GENERATED_TEXT_S
7870: 54 41 52 54 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78  TART.func_mmmv_x
7880: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7890: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
78a0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
78b0: 65 72 5f 74 31 20 20 22 30 30 30 30 30 22 20 20  er_t1  "00000"  
78c0: 22 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f  "0".func_mmmv_x_
78d0: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
78e0: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
78f0: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
7900: 72 5f 74 31 20 20 22 2b 30 30 30 30 2e 30 22 20  r_t1  "+0000.0" 
7910: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
7920: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
7930: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
7940: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
7950: 72 5f 74 31 20 20 22 2b 30 30 30 30 30 22 20 20  r_t1  "+00000"  
7960: 22 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f  "0".func_mmmv_x_
7970: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
7980: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
7990: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
79a0: 72 5f 74 31 20 20 22 2b 30 22 20 20 22 30 22 0a  r_t1  "+0"  "0".
79b0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
79c0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
79d0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
79e0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
79f0: 20 20 22 30 22 20 20 22 30 22 0a 66 75 6e 63 5f    "0"  "0".func_
7a00: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
7a10: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
7a20: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
7a30: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30 2b  1_tester_t1  "0+
7a40: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
7a50: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
7a60: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
7a70: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
7a80: 74 65 72 5f 74 31 20 20 22 2b 30 30 30 30 2c 30  ter_t1  "+0000,0
7a90: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
7aa0: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
7ab0: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
7ac0: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
7ad0: 74 65 72 5f 74 31 20 20 22 2d 30 30 30 30 30 22  ter_t1  "-00000"
7ae0: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
7af0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7b00: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
7b10: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
7b20: 65 72 5f 74 31 20 20 22 2d 30 30 30 30 2c 30 22  er_t1  "-0000,0"
7b30: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
7b40: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7b50: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
7b60: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
7b70: 65 72 5f 74 31 20 20 22 2d 30 30 30 30 2e 30 22  er_t1  "-0000.0"
7b80: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
7b90: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7ba0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
7bb0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
7bc0: 65 72 5f 74 31 20 20 22 2d 30 30 30 30 30 2d 22  er_t1  "-00000-"
7bd0: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
7be0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7bf0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
7c00: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
7c10: 65 72 5f 74 31 20 20 22 30 30 30 30 30 2d 22 20  er_t1  "00000-" 
7c20: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
7c30: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
7c40: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
7c50: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
7c60: 72 5f 74 31 20 20 22 30 30 30 30 30 20 22 20 20  r_t1  "00000 "  
7c70: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
7c80: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
7c90: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
7ca0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
7cb0: 5f 74 31 20 20 22 20 30 30 30 30 30 22 20 20 22  _t1  " 00000"  "
7cc0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
7cd0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
7ce0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
7cf0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
7d00: 74 31 20 20 22 2d 2d 30 30 30 30 30 22 20 20 22  t1  "--00000"  "
7d10: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
7d20: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
7d30: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
7d40: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
7d50: 74 31 20 20 22 2b 2b 30 30 30 30 30 22 20 20 22  t1  "++00000"  "
7d60: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
7d70: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
7d80: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
7d90: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
7da0: 74 31 20 20 22 30 30 30 2d 30 30 22 20 20 22 22  t1  "000-00"  ""
7db0: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
7dc0: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
7dd0: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
7de0: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
7df0: 31 20 20 22 2d 30 22 20 20 22 22 0a 66 75 6e 63  1  "-0"  "".func
7e00: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
7e10: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
7e20: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
7e30: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 30  t1_tester_t1  "0
7e40: 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  -"  "".func_mmmv
7e50: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
7e60: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
7e70: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
7e80: 73 74 65 72 5f 74 31 20 20 22 30 30 30 30 2d 22  ster_t1  "0000-"
7e90: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
7ea0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
7eb0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
7ec0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
7ed0: 65 72 5f 74 31 20 20 22 2b 30 30 30 30 2d 22 20  er_t1  "+0000-" 
7ee0: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
7ef0: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
7f00: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
7f10: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
7f20: 72 5f 74 31 20 20 22 2d 30 30 30 30 2d 22 20 20  r_t1  "-0000-"  
7f30: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
7f40: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
7f50: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
7f60: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
7f70: 5f 74 31 20 20 22 2d 30 30 30 30 2b 22 20 20 22  _t1  "-0000+"  "
7f80: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
7f90: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
7fa0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
7fb0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
7fc0: 74 31 20 20 22 30 30 30 30 2b 22 20 20 22 22 0a  t1  "0000+"  "".
7fd0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
7fe0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
7ff0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8000: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8010: 20 20 22 30 30 30 2b 30 30 22 20 20 22 22 0a 66    "000+00"  "".f
8020: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8030: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8040: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8050: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
8060: 20 22 30 30 30 34 32 22 20 20 22 34 32 22 0a 66   "00042"  "42".f
8070: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8080: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8090: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
80a0: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
80b0: 20 22 2b 30 30 30 34 32 22 20 20 22 34 32 22 0a   "+00042"  "42".
80c0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
80d0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
80e0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
80f0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8100: 20 20 22 30 30 34 32 30 22 20 20 22 34 32 30 22    "00420"  "420"
8110: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
8120: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
8130: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
8140: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
8150: 31 20 20 22 2b 30 30 34 32 30 22 20 20 22 34 32  1  "+00420"  "42
8160: 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  0".func_mmmv_x_p
8170: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
8180: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
8190: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
81a0: 5f 74 31 20 20 22 30 30 34 32 30 2b 22 20 20 22  _t1  "00420+"  "
81b0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
81c0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
81d0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
81e0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
81f0: 74 31 20 20 22 30 30 34 2b 32 30 22 20 20 22 22  t1  "004+20"  ""
8200: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
8210: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
8220: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
8230: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
8240: 31 20 20 22 34 32 30 22 20 20 22 34 32 30 22 0a  1  "420"  "420".
8250: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
8260: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8270: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8280: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8290: 20 20 22 2b 34 32 30 22 20 20 22 34 32 30 22 0a    "+420"  "420".
82a0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
82b0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
82c0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
82d0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
82e0: 20 20 22 34 32 30 2b 22 20 20 22 22 0a 66 75 6e    "420+"  "".fun
82f0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8300: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8310: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8320: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8330: 31 22 20 20 22 31 22 0a 66 75 6e 63 5f 6d 6d 6d  1"  "1".func_mmm
8340: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8350: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8360: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8370: 65 73 74 65 72 5f 74 31 20 20 22 2d 31 22 20 20  ester_t1  "-1"  
8380: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
8390: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
83a0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
83b0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
83c0: 5f 74 31 20 20 22 31 2d 22 20 20 22 22 0a 66 75  _t1  "1-"  "".fu
83d0: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
83e0: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
83f0: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
8400: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
8410: 22 2b 31 22 20 20 22 31 22 0a 66 75 6e 63 5f 6d  "+1"  "1".func_m
8420: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
8430: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
8440: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
8450: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 39 22 20  _tester_t1  "9" 
8460: 20 22 39 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78   "9".func_mmmv_x
8470: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
8480: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8490: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
84a0: 65 72 5f 74 31 20 20 22 2b 39 22 20 20 22 39 22  er_t1  "+9"  "9"
84b0: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
84c0: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
84d0: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
84e0: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
84f0: 31 20 20 22 39 30 30 30 22 20 20 22 39 30 30 30  1  "9000"  "9000
8500: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
8510: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
8520: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
8530: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
8540: 74 31 20 20 22 30 39 30 30 30 22 20 20 22 39 30  t1  "09000"  "90
8550: 30 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f  00".func_mmmv_x_
8560: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8570: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8580: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8590: 72 5f 74 31 20 20 22 2b 30 39 30 30 30 22 20 20  r_t1  "+09000"  
85a0: 22 39 30 30 30 22 0a 66 75 6e 63 5f 6d 6d 6d 76  "9000".func_mmmv
85b0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
85c0: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
85d0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
85e0: 73 74 65 72 5f 74 31 20 20 22 2b 2b 30 39 30 30  ster_t1  "++0900
85f0: 30 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  0"  "".func_mmmv
8600: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
8610: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
8620: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8630: 73 74 65 72 5f 74 31 20 20 22 30 39 30 30 30 2b  ster_t1  "09000+
8640: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
8650: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
8660: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
8670: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
8680: 74 65 72 5f 74 31 20 20 22 30 39 30 30 30 2d 22  ter_t1  "09000-"
8690: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
86a0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
86b0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
86c0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
86d0: 65 72 5f 74 31 20 20 22 30 39 30 30 30 2d 2d 22  er_t1  "09000--"
86e0: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
86f0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
8700: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8710: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
8720: 65 72 5f 74 31 20 20 22 2d 39 22 20 20 22 22 0a  er_t1  "-9"  "".
8730: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
8740: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8750: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8760: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8770: 20 20 22 2b 2b 39 22 20 20 22 22 0a 66 75 6e 63    "++9"  "".func
8780: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8790: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
87a0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
87b0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 39  t1_tester_t1  "9
87c0: 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  +"  "".func_mmmv
87d0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
87e0: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
87f0: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8800: 73 74 65 72 5f 74 31 20 20 22 39 2b 2b 22 20 20  ster_t1  "9++"  
8810: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
8820: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
8830: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
8840: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
8850: 5f 74 31 20 20 22 39 2b 2d 22 20 20 22 22 0a 66  _t1  "9+-"  "".f
8860: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8870: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8880: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8890: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
88a0: 20 22 2b 2d 39 22 20 20 22 22 0a 66 75 6e 63 5f   "+-9"  "".func_
88b0: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
88c0: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
88d0: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
88e0: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34 32  1_tester_t1  "42
88f0: 22 20 20 22 34 32 22 0a 66 75 6e 63 5f 6d 6d 6d  "  "42".func_mmm
8900: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8910: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8920: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8930: 65 73 74 65 72 5f 74 31 20 20 22 2b 34 32 22 20  ester_t1  "+42" 
8940: 20 22 34 32 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f   "42".func_mmmv_
8950: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
8960: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
8970: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
8980: 74 65 72 5f 74 31 20 20 22 2b 2b 34 32 22 20 20  ter_t1  "++42"  
8990: 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70  "".func_mmmv_x_p
89a0: 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75  ositive_whole_nu
89b0: 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79  mber_or_an_empty
89c0: 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72  string_t1_tester
89d0: 5f 74 31 20 20 22 2b 34 32 20 22 20 20 22 22 0a  _t1  "+42 "  "".
89e0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
89f0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
8a00: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
8a10: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
8a20: 20 20 22 2b 34 20 32 22 20 20 22 22 0a 66 75 6e    "+4 2"  "".fun
8a30: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
8a40: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
8a50: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
8a60: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
8a70: 20 2b 34 20 32 22 20 20 22 22 0a 66 75 6e 63 5f   +4 2"  "".func_
8a80: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
8a90: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
8aa0: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
8ab0: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 20 2b  1_tester_t1  " +
8ac0: 34 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  42"  "".func_mmm
8ad0: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
8ae0: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
8af0: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
8b00: 65 73 74 65 72 5f 74 31 20 20 22 2d 34 32 22 20  ester_t1  "-42" 
8b10: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
8b20: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
8b30: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
8b40: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
8b50: 72 5f 74 31 20 20 22 20 2d 34 32 22 20 20 22 22  r_t1  " -42"  ""
8b60: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
8b70: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
8b80: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
8b90: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
8ba0: 31 20 20 22 20 2d 34 32 20 22 20 20 22 22 0a 66  1  " -42 "  "".f
8bb0: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8bc0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8bd0: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8be0: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
8bf0: 20 22 2d 2d 34 32 22 20 20 22 22 0a 66 75 6e 63   "--42"  "".func
8c00: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8c10: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
8c20: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
8c30: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d  t1_tester_t1  "-
8c40: 2d 2d 2d 34 32 22 20 20 22 22 0a 66 75 6e 63 5f  ---42"  "".func_
8c50: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
8c60: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
8c70: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
8c80: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b 34  1_tester_t1  "+4
8c90: 32 2d 2d 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d  2---"  "".func_m
8ca0: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
8cb0: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
8cc0: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
8cd0: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d 34 2d  _tester_t1  "-4-
8ce0: 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  2"  "".func_mmmv
8cf0: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
8d00: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
8d10: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
8d20: 73 74 65 72 5f 74 31 20 20 22 2d 34 2d 32 2d 22  ster_t1  "-4-2-"
8d30: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
8d40: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
8d50: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8d60: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
8d70: 65 72 5f 74 31 20 20 22 34 2d 32 2d 22 20 20 22  er_t1  "4-2-"  "
8d80: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
8d90: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
8da0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
8db0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
8dc0: 74 31 20 20 22 34 32 2d 22 20 20 22 22 0a 66 75  t1  "42-"  "".fu
8dd0: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
8de0: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
8df0: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
8e00: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
8e10: 22 34 32 2d 2d 2d 22 20 20 22 22 0a 66 75 6e 63  "42---"  "".func
8e20: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8e30: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
8e40: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
8e50: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b  t1_tester_t1  "+
8e60: 34 2b 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d  4+2"  "".func_mm
8e70: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
8e80: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
8e90: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
8ea0: 74 65 73 74 65 72 5f 74 31 20 20 22 34 2b 32 22  tester_t1  "4+2"
8eb0: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
8ec0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
8ed0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
8ee0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
8ef0: 65 72 5f 74 31 20 20 22 34 32 2b 22 20 20 22 22  er_t1  "42+"  ""
8f00: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
8f10: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
8f20: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
8f30: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
8f40: 31 20 20 22 34 32 2b 2b 2b 22 20 20 22 22 0a 66  1  "42+++"  "".f
8f50: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
8f60: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
8f70: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
8f80: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
8f90: 20 22 2b 34 32 2b 22 20 20 22 22 0a 66 75 6e 63   "+42+"  "".func
8fa0: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
8fb0: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
8fc0: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
8fd0: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34  t1_tester_t1  "4
8fe0: 2e 32 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d  .2"  "".func_mmm
8ff0: 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f  v_x_positive_who
9000: 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f  le_number_or_an_
9010: 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74  emptystring_t1_t
9020: 65 73 74 65 72 5f 74 31 20 20 22 34 2c 32 22 20  ester_t1  "4,2" 
9030: 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f   "".func_mmmv_x_
9040: 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e  positive_whole_n
9050: 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74  umber_or_an_empt
9060: 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65  ystring_t1_teste
9070: 72 5f 74 31 20 20 22 34 20 32 22 20 20 22 22 0a  r_t1  "4 2"  "".
9080: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
9090: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
90a0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
90b0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
90c0: 20 20 22 34 20 2b 32 22 20 20 22 22 0a 66 75 6e    "4 +2"  "".fun
90d0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
90e0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
90f0: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
9100: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
9110: 34 20 32 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d  4 2+"  "".func_m
9120: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
9130: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
9140: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
9150: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34 32 20  _tester_t1  "42 
9160: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
9170: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
9180: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
9190: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
91a0: 74 65 72 5f 74 31 20 20 22 34 32 2e 22 20 20 22  ter_t1  "42."  "
91b0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
91c0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
91d0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
91e0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
91f0: 74 31 20 20 22 34 32 2c 22 20 20 22 22 0a 66 75  t1  "42,"  "".fu
9200: 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69  nc_mmmv_x_positi
9210: 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f  ve_whole_number_
9220: 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e  or_an_emptystrin
9230: 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20  g_t1_tester_t1  
9240: 22 61 20 20 62 63 22 20 20 22 22 0a 66 75 6e 63  "a  bc"  "".func
9250: 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65  _mmmv_x_positive
9260: 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72  _whole_number_or
9270: 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f  _an_emptystring_
9280: 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 22  t1_tester_t1  ""
9290: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
92a0: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
92b0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
92c0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
92d0: 65 72 5f 74 31 20 20 22 2b 22 20 20 22 22 0a 66  er_t1  "+"  "".f
92e0: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
92f0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
9300: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
9310: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
9320: 20 22 2b 2b 22 20 20 22 22 0a 66 75 6e 63 5f 6d   "++"  "".func_m
9330: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
9340: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
9350: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
9360: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2b 2b 2b  _tester_t1  "+++
9370: 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f  "  "".func_mmmv_
9380: 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65  x_positive_whole
9390: 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d  _number_or_an_em
93a0: 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73  ptystring_t1_tes
93b0: 74 65 72 5f 74 31 20 20 22 2d 22 20 20 22 22 0a  ter_t1  "-"  "".
93c0: 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69  func_mmmv_x_posi
93d0: 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65  tive_whole_numbe
93e0: 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72  r_or_an_emptystr
93f0: 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31  ing_t1_tester_t1
9400: 20 20 22 2d 2d 22 20 20 22 22 0a 66 75 6e 63 5f    "--"  "".func_
9410: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
9420: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
9430: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
9440: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 2d 2d  1_tester_t1  "--
9450: 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  -"  "".func_mmmv
9460: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
9470: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
9480: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
9490: 73 74 65 72 5f 74 31 20 20 22 2d 2b 22 20 20 22  ster_t1  "-+"  "
94a0: 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f  ".func_mmmv_x_po
94b0: 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d  sitive_whole_num
94c0: 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73  ber_or_an_emptys
94d0: 74 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f  tring_t1_tester_
94e0: 74 31 20 20 22 2b 2d 22 20 20 22 22 0a 66 75 6e  t1  "+-"  "".fun
94f0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
9500: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
9510: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
9520: 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22  _t1_tester_t1  "
9530: 2b 2d 2d 2d 22 20 20 22 22 0a 66 75 6e 63 5f 6d  +---"  "".func_m
9540: 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
9550: 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
9560: 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
9570: 5f 74 65 73 74 65 72 5f 74 31 20 20 22 5c 22 22  _tester_t1  "\""
9580: 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78    "".func_mmmv_x
9590: 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c 65 5f  _positive_whole_
95a0: 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70  number_or_an_emp
95b0: 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65 73 74  tystring_t1_test
95c0: 65 72 5f 74 31 20 20 22 27 22 20 20 22 22 0a 66  er_t1  "'"  "".f
95d0: 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74  unc_mmmv_x_posit
95e0: 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72  ive_whole_number
95f0: 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69  _or_an_emptystri
9600: 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74 31 20  ng_t1_tester_t1 
9610: 20 22 27 34 32 22 20 20 22 22 0a 66 75 6e 63 5f   "'42"  "".func_
9620: 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f  mmmv_x_positive_
9630: 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f  whole_number_or_
9640: 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74  an_emptystring_t
9650: 31 5f 74 65 73 74 65 72 5f 74 31 20 20 22 34 32  1_tester_t1  "42
9660: 27 22 20 20 22 22 0a 66 75 6e 63 5f 6d 6d 6d 76  '"  "".func_mmmv
9670: 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68 6f 6c  _x_positive_whol
9680: 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e 5f 65  e_number_or_an_e
9690: 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f 74 65  mptystring_t1_te
96a0: 73 74 65 72 5f 74 31 20 20 22 20 22 20 20 22 22  ster_t1  " "  ""
96b0: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73  .func_mmmv_x_pos
96c0: 69 74 69 76 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62  itive_whole_numb
96d0: 65 72 5f 6f 72 5f 61 6e 5f 65 6d 70 74 79 73 74  er_or_an_emptyst
96e0: 72 69 6e 67 5f 74 31 5f 74 65 73 74 65 72 5f 74  ring_t1_tester_t
96f0: 31 20 20 22 20 20 20 22 20 20 22 22 0a 0a 23 20  1  "   "  ""..# 
9700: 52 45 4e 45 53 53 41 41 54 4f 52 5f 41 55 54 4f  RENESSAATOR_AUTO
9710: 47 45 4e 45 52 41 54 45 44 5f 54 45 58 54 5f 45  GENERATED_TEXT_E
9720: 4e 44 0a 23 20 52 45 4e 45 53 53 41 41 54 4f 52  ND.# RENESSAATOR
9730: 5f 42 4c 4f 43 4b 5f 45 4e 44 0a 23 2d 2d 2d 2d  _BLOCK_END.#----
9740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9750: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9760: 2d 2d 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d  ----.} # func_mm
9770: 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77 68  mv_x_positive_wh
9780: 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61 6e  ole_number_or_an
9790: 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31 5f  _emptystring_t1_
97a0: 74 65 73 74 65 72 5f 74 32 0a 0a 23 20 66 75 6e  tester_t2..# fun
97b0: 63 5f 6d 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76  c_mmmv_x_positiv
97c0: 65 5f 77 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f  e_whole_number_o
97d0: 72 5f 61 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67  r_an_emptystring
97e0: 5f 74 31 5f 74 65 73 74 65 72 5f 74 32 0a 23 20  _t1_tester_t2.# 
97f0: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
9800: 74 68 20 61 6e 20 65 72 72 6f 72 2c 20 62 65 63  th an error, bec
9810: 61 75 73 65 20 74 68 65 20 74 65 73 74 20 63 6f  ause the test co
9820: 64 65 20 73 68 6f 75 6c 64 20 62 65 20 6f 75 74  de should be out
9830: 63 6f 6d 6d 65 6e 74 65 64 2e 0a 0a 23 2d 2d 2d  commented...#---
9840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9850: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9860: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9870: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9880: 2d 2d 2d 2d 2d 2d 2d 0a 0a 23 20 54 68 72 6f 77  -------..# Throw
9890: 73 2c 20 69 66 20 74 68 65 20 61 72 67 75 6d 65  s, if the argume
98a0: 6e 74 20 69 73 20 70 72 65 73 65 6e 74 2e 0a 66  nt is present..f
98b0: 75 6e 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f  unc_mmmv_assert_
98c0: 61 72 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31  arg_is_absent_t1
98d0: 28 29 20 7b 0a 20 20 20 20 6c 6f 63 61 6c 20 53  () {.    local S
98e0: 5f 41 52 47 5f 58 3d 22 24 31 22 20 0a 20 20 20  _ARG_X="$1" .   
98f0: 20 6c 6f 63 61 6c 20 53 5f 41 52 47 5f 58 5f 4e   local S_ARG_X_N
9900: 41 4d 45 3d 22 24 32 22 20 0a 20 20 20 20 6c 6f  AME="$2" .    lo
9910: 63 61 6c 20 53 5f 47 55 49 44 3d 22 24 33 22 20  cal S_GUID="$3" 
9920: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  .    #--------. 
9930: 20 20 20 69 66 20 5b 20 22 24 53 5f 47 55 49 44     if [ "$S_GUID
9940: 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e  " == "" ] ; then
9950: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
9960: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54  .        echo "T
9970: 68 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  he implementatio
9980: 6e 20 6f 66 20 74 68 65 20 66 75 6e 63 74 69 6f  n of the functio
9990: 6e 20 74 68 61 74 20 22 0a 20 20 20 20 20 20 20  n that ".       
99a0: 20 65 63 68 6f 20 22 63 61 6c 6c 73 20 74 68 65   echo "calls the
99b0: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
99c0: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
99d0: 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61  "    func_mmmv_a
99e0: 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73  ssert_arg_is_abs
99f0: 65 6e 74 5f 74 31 22 0a 20 20 20 20 20 20 20 20  ent_t1".        
9a00: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
9a10: 65 63 68 6f 20 22 69 73 20 66 6c 61 77 65 64 2e  echo "is flawed.
9a20: 20 54 68 65 20 63 61 6c 6c 20 74 6f 20 74 68 65   The call to the
9a30: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
9a40: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
9a50: 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61  "    func_mmmv_a
9a60: 73 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73  ssert_arg_is_abs
9a70: 65 6e 74 5f 74 31 22 0a 20 20 20 20 20 20 20 20  ent_t1".        
9a80: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
9a90: 65 63 68 6f 20 22 6d 69 73 73 65 73 20 74 68 65  echo "misses the
9aa0: 20 74 68 69 72 64 20 66 75 6e 63 74 69 6f 6e 20   third function 
9ab0: 61 72 67 75 6d 65 6e 74 2c 20 22 0a 20 20 20 20  argument, ".    
9ac0: 20 20 20 20 65 63 68 6f 20 22 77 68 69 63 68 20      echo "which 
9ad0: 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 62  is expected to b
9ae0: 65 20 61 20 47 55 49 44 2e 22 0a 20 20 20 20 20  e a GUID.".     
9af0: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
9b00: 33 34 62 38 34 38 62 32 2d 30 37 35 31 2d 34 32  34b848b2-0751-42
9b10: 35 64 2d 62 66 34 66 2d 38 30 32 30 37 30 65 30  5d-bf4f-802070e0
9b20: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
9b30: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
9b40: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
9b50: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
9b60: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
9b70: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
9b80: 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
9b90: 41 52 47 5f 58 5f 4e 41 4d 45 22 20 3d 3d 20 22  ARG_X_NAME" == "
9ba0: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
9bb0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
9bc0: 20 20 20 65 63 68 6f 20 22 54 68 65 20 69 6d 70     echo "The imp
9bd0: 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74  lementation of t
9be0: 68 65 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74  he function that
9bf0: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
9c00: 22 63 61 6c 6c 73 20 74 68 65 20 22 0a 20 20 20  "calls the ".   
9c10: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
9c20: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 66       echo "    f
9c30: 75 6e 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f  unc_mmmv_assert_
9c40: 61 72 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31  arg_is_absent_t1
9c50: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
9c60: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
9c70: 69 73 20 66 6c 61 77 65 64 2e 20 54 68 65 20 63  is flawed. The c
9c80: 61 6c 6c 20 74 6f 20 74 68 65 20 22 0a 20 20 20  all to the ".   
9c90: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
9ca0: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 66       echo "    f
9cb0: 75 6e 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f  unc_mmmv_assert_
9cc0: 61 72 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31  arg_is_absent_t1
9cd0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
9ce0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
9cf0: 6d 69 73 73 65 73 20 74 68 65 20 73 65 63 6f 6e  misses the secon
9d00: 64 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75 6d  d function argum
9d10: 65 6e 74 2e 22 0a 20 20 20 20 20 20 20 20 65 63  ent.".        ec
9d20: 68 6f 20 22 47 55 49 44 3d 3d 27 35 33 63 61 61  ho "GUID=='53caa
9d30: 63 35 62 2d 63 35 36 30 2d 34 65 35 39 2d 38 34  c5b-c560-4e59-84
9d40: 34 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  4f-802070e031e7'
9d50: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
9d60: 47 55 49 44 3d 3d 27 24 53 5f 47 55 49 44 27 22  GUID=='$S_GUID'"
9d70: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
9d80: 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
9d90: 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
9da0: 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
9db0: 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
9dc0: 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
9dd0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69   #--------.    i
9de0: 66 20 5b 20 22 24 53 5f 41 52 47 5f 58 22 20 21  f [ "$S_ARG_X" !
9df0: 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  = "" ] ; then.  
9e00: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
9e10: 20 20 20 20 20 20 65 63 68 6f 20 22 49 66 20 74        echo "If t
9e20: 68 65 20 66 69 72 73 74 20 63 6f 6e 73 6f 6c 65  he first console
9e30: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 5c 22 24   argument is \"$
9e40: 53 5f 41 52 47 56 5f 30 5c 22 2c 20 74 68 65 6e  S_ARGV_0\", then
9e50: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
9e60: 22 74 68 65 20 24 53 5f 41 52 47 5f 58 5f 4e 41  "the $S_ARG_X_NA
9e70: 4d 45 20 69 73 20 72 65 71 75 69 72 65 64 20 74  ME is required t
9e80: 6f 20 62 65 20 61 62 73 65 6e 74 2c 20 22 0a 20  o be absent, ". 
9e90: 20 20 20 20 20 20 20 65 63 68 6f 20 22 62 75 74         echo "but
9ea0: 20 63 75 72 72 65 6e 74 6c 79 20 22 0a 20 20 20   currently ".   
9eb0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
9ec0: 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 3c       echo "    <
9ed0: 24 53 5f 41 52 47 5f 58 5f 4e 41 4d 45 3e 3d 24  $S_ARG_X_NAME>=$
9ee0: 53 5f 41 52 47 5f 58 22 0a 20 20 20 20 20 20 20  S_ARG_X".       
9ef0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
9f00: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 33 66   echo "GUID=='3f
9f10: 62 61 36 39 31 37 2d 64 66 30 64 2d 34 31 31 32  ba6917-df0d-4112
9f20: 2d 62 31 34 66 2d 38 30 32 30 37 30 65 30 33 31  -b14f-802070e031
9f30: 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
9f40: 6f 20 22 47 55 49 44 3d 3d 27 24 53 5f 47 55 49  o "GUID=='$S_GUI
9f50: 44 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  D'".        echo
9f60: 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
9f70: 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
9f80: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
9f90: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
9fa0: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
9fb0: 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73  } # func_mmmv_as
9fc0: 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73 65  sert_arg_is_abse
9fd0: 6e 74 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  nt_t1...#-------
9fe0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9ff0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a000: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a020: 2d 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 65  ---..func_mmmv_e
a030: 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69 6f 6e  xc_hash_function
a040: 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63 61 74  _input_verificat
a050: 69 6f 6e 5f 74 31 28 29 20 7b 20 0a 20 20 20 20  ion_t1() { .    
a060: 6c 6f 63 61 6c 20 53 5f 4e 41 4d 45 5f 4f 46 5f  local S_NAME_OF_
a070: 54 48 45 5f 42 41 53 48 5f 46 55 4e 43 54 49 4f  THE_BASH_FUNCTIO
a080: 4e 3d 22 24 31 22 20 23 20 54 68 65 20 6e 61 6d  N="$1" # The nam
a090: 65 20 6f 66 20 74 68 65 20 42 61 73 68 20 66 75  e of the Bash fu
a0a0: 6e 63 74 69 6f 6e 2e 0a 20 20 20 20 6c 6f 63 61  nction..    loca
a0b0: 6c 20 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53  l S_FP_2_AN_EXIS
a0c0: 54 49 4e 47 5f 46 49 4c 45 3d 22 24 32 22 20 23  TING_FILE="$2" #
a0d0: 20 54 68 65 20 66 69 72 73 74 20 61 72 67 75 6d   The first argum
a0e0: 65 6e 74 20 6f 66 20 74 68 65 20 42 61 73 68 20  ent of the Bash 
a0f0: 66 75 6e 63 74 69 6f 6e 2e 0a 20 20 20 20 23 2d  function..    #-
a100: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61  -------.    loca
a110: 6c 20 53 5f 54 4d 50 5f 30 3d 22 22 20 23 20 64  l S_TMP_0="" # d
a120: 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20 20 20 6c  eclaration.    l
a130: 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22 22 20  ocal S_TMP_1="" 
a140: 23 20 64 65 63 6c 61 72 61 74 69 6f 6e 0a 20 20  # declaration.  
a150: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
a160: 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45 5f 4f 46  if [ "$S_NAME_OF
a170: 5f 54 48 45 5f 42 41 53 48 5f 46 55 4e 43 54 49  _THE_BASH_FUNCTI
a180: 4f 4e 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  ON" == "" ] ; th
a190: 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  en.        echo 
a1a0: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
a1b0: 22 54 68 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74  "The implementat
a1c0: 69 6f 6e 20 6f 66 20 74 68 65 20 66 75 6e 63 74  ion of the funct
a1d0: 69 6f 6e 20 74 68 61 74 20 22 0a 20 20 20 20 20  ion that ".     
a1e0: 20 20 20 65 63 68 6f 20 22 63 61 6c 6c 73 20 74     echo "calls t
a1f0: 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
a200: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
a210: 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  o "    func_mmmv
a220: 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69  _exc_hash_functi
a230: 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63  on_input_verific
a240: 61 74 69 6f 6e 5f 74 31 22 0a 20 20 20 20 20 20  ation_t1".      
a250: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
a260: 20 20 65 63 68 6f 20 22 69 73 20 66 6c 61 77 65    echo "is flawe
a270: 64 2e 20 54 68 65 20 63 61 6c 6c 20 74 6f 20 74  d. The call to t
a280: 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
a290: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
a2a0: 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  o "    func_mmmv
a2b0: 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69  _exc_hash_functi
a2c0: 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63  on_input_verific
a2d0: 61 74 69 6f 6e 5f 74 31 22 0a 20 20 20 20 20 20  ation_t1".      
a2e0: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
a2f0: 20 20 65 63 68 6f 20 22 6d 69 73 73 65 73 20 74    echo "misses t
a300: 68 65 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e  he first argumen
a310: 74 20 6f 72 20 74 68 65 20 66 69 72 73 74 20 61  t or the first a
a320: 72 67 75 6d 65 6e 74 20 69 73 20 61 6e 20 65 6d  rgument is an em
a330: 70 74 79 20 73 74 72 69 6e 67 2e 22 0a 20 20 20  pty string.".   
a340: 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
a350: 3d 27 62 63 36 39 32 33 32 65 2d 35 36 36 39 2d  ='bc69232e-5669-
a360: 34 64 36 35 2d 61 33 34 66 2d 38 30 32 30 37 30  4d65-a34f-802070
a370: 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
a380: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
a390: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
a3a0: 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
a3b0: 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
a3c0: 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
a3d0: 20 20 66 69 0a 20 20 20 20 53 5f 54 4d 50 5f 30    fi.    S_TMP_0
a3e0: 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69  ="`ruby -e \"pri
a3f0: 6e 74 28 27 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54  nt('$S_NAME_OF_T
a400: 48 45 5f 42 41 53 48 5f 46 55 4e 43 54 49 4f 4e  HE_BASH_FUNCTION
a410: 27 2e 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c 73  '.to_s.gsub(/[\s
a420: 5d 2b 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20  ]+/,''));\" `". 
a430: 20 20 20 69 66 20 5b 20 22 24 53 5f 4e 41 4d 45     if [ "$S_NAME
a440: 5f 4f 46 5f 54 48 45 5f 42 41 53 48 5f 46 55 4e  _OF_THE_BASH_FUN
a450: 43 54 49 4f 4e 22 20 21 3d 20 22 24 53 5f 54 4d  CTION" != "$S_TM
a460: 50 5f 30 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  P_0" ] ; then.  
a470: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
a480: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
a490: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f  implementation o
a4a0: 66 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 74  f the function t
a4b0: 68 61 74 20 22 0a 20 20 20 20 20 20 20 20 65 63  hat ".        ec
a4c0: 68 6f 20 22 63 61 6c 6c 73 20 74 68 65 20 22 0a  ho "calls the ".
a4d0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
a4e0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
a4f0: 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f    func_mmmv_exc_
a500: 68 61 73 68 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e  hash_function_in
a510: 70 75 74 5f 76 65 72 69 66 69 63 61 74 69 6f 6e  put_verification
a520: 5f 74 31 22 0a 20 20 20 20 20 20 20 20 65 63 68  _t1".        ech
a530: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
a540: 6f 20 22 69 73 20 66 6c 61 77 65 64 2e 20 46 75  o "is flawed. Fu
a550: 6e 63 74 69 6f 6e 20 6e 61 6d 65 73 20 61 72 65  nction names are
a560: 20 6e 6f 74 20 61 6c 6c 6f 77 65 64 20 74 6f 20   not allowed to 
a570: 63 6f 6e 74 61 69 6e 20 73 70 61 63 65 73 20 6f  contain spaces o
a580: 72 20 74 61 62 73 2e 22 0a 20 20 20 20 20 20 20  r tabs.".       
a590: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 38 62   echo "GUID=='8b
a5a0: 32 32 37 65 34 32 2d 37 39 36 31 2d 34 36 30 35  227e42-7961-4605
a5b0: 2d 61 33 34 66 2d 38 30 32 30 37 30 65 30 33 31  -a34f-802070e031
a5c0: 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68  e7'".        ech
a5d0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  o "".        #--
a5e0: 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
a5f0: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
a600: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
a610: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69  ith error.    fi
a620: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  .    #--------. 
a630: 20 20 20 23 20 46 75 6e 63 74 69 6f 6e 20 63 61     # Function ca
a640: 6c 6c 73 20 6c 69 6b 65 0a 20 20 20 20 23 0a 20  lls like.    #. 
a650: 20 20 20 23 20 20 20 20 20 3c 66 75 6e 63 74 69     #     <functi
a660: 6f 6e 20 6e 61 6d 65 3e 20 22 22 0a 20 20 20 20  on name> "".    
a670: 23 20 20 20 20 20 3c 66 75 6e 63 74 69 6f 6e 20  #     <function 
a680: 6e 61 6d 65 3e 20 22 20 22 0a 20 20 20 20 23 0a  name> " ".    #.
a690: 20 20 20 20 23 20 61 72 65 20 6e 6f 74 20 61 6c      # are not al
a6a0: 6c 6f 77 65 64 2e 0a 20 20 20 20 53 5f 54 4d 50  lowed..    S_TMP
a6b0: 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70  _0="`ruby -e \"p
a6c0: 72 69 6e 74 28 27 24 53 5f 46 50 5f 32 5f 41 4e  rint('$S_FP_2_AN
a6d0: 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 27 2e  _EXISTING_FILE'.
a6e0: 74 6f 5f 73 2e 67 73 75 62 28 2f 5b 5c 73 5d 2b  to_s.gsub(/[\s]+
a6f0: 2f 2c 27 27 29 29 3b 5c 22 20 60 22 0a 20 20 20  /,''));\" `".   
a700: 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22   if [ "$S_TMP_0"
a710: 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
a720: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
a730: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
a740: 65 20 42 61 73 68 20 66 75 6e 63 74 69 6f 6e 20  e Bash function 
a750: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a760: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a770: 20 20 20 20 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54      $S_NAME_OF_T
a780: 48 45 5f 42 41 53 48 5f 46 55 4e 43 54 49 4f 4e  HE_BASH_FUNCTION
a790: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a7a0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a7b0: 69 73 20 6e 6f 74 20 64 65 73 69 67 6e 65 64 20  is not designed 
a7c0: 74 6f 20 68 61 6e 64 6c 65 20 61 6e 20 61 72 67  to handle an arg
a7d0: 75 6d 65 6e 74 20 74 68 61 74 20 22 0a 20 20 20  ument that ".   
a7e0: 20 20 20 20 20 65 63 68 6f 20 22 65 71 75 61 6c       echo "equal
a7f0: 73 20 77 69 74 68 20 61 6e 20 65 6d 70 74 79 20  s with an empty 
a800: 73 74 72 69 6e 67 20 6f 72 20 61 20 73 65 72 69  string or a seri
a810: 65 73 20 6f 66 20 73 70 61 63 65 73 20 61 6e 64  es of spaces and
a820: 20 74 61 62 73 2e 22 0a 20 20 20 20 20 20 20 20   tabs.".        
a830: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 30 30 36  echo "GUID=='006
a840: 66 63 37 32 35 2d 37 32 62 35 2d 34 63 66 62 2d  fc725-72b5-4cfb-
a850: 38 33 33 66 2d 38 30 32 30 37 30 65 30 33 31 65  833f-802070e031e
a860: 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
a870: 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
a880: 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
a890: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
a8a0: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
a8b0: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
a8c0: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
a8d0: 20 20 69 66 20 5b 20 21 20 2d 65 20 24 53 5f 46    if [ ! -e $S_F
a8e0: 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f  P_2_AN_EXISTING_
a8f0: 46 49 4c 45 20 5d 20 3b 20 74 68 65 6e 0a 20 20  FILE ] ; then.  
a900: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
a910: 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
a920: 66 69 6c 65 20 22 0a 20 20 20 20 20 20 20 20 65  file ".        e
a930: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
a940: 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 32  cho "    $S_FP_2
a950: 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c  _AN_EXISTING_FIL
a960: 45 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  E ".        echo
a970: 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
a980: 20 22 69 73 20 6d 69 73 73 69 6e 67 20 6f 72 20   "is missing or 
a990: 69 74 20 69 73 20 61 20 62 72 6f 6b 65 6e 20 6c  it is a broken l
a9a0: 69 6e 6b 2e 22 0a 20 20 20 20 20 20 20 20 65 63  ink.".        ec
a9b0: 68 6f 20 22 47 55 49 44 3d 3d 27 61 32 34 39 37  ho "GUID=='a2497
a9c0: 31 33 39 2d 39 37 35 37 2d 34 36 36 35 2d 62 32  139-9757-4665-b2
a9d0: 33 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  3f-802070e031e7'
a9e0: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
a9f0: 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
aa00: 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
aa10: 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78  _ORIG.        ex
aa20: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
aa30: 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20   error.    fi.  
aa40: 20 20 69 66 20 5b 20 2d 64 20 24 53 5f 46 50 5f    if [ -d $S_FP_
aa50: 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49  2_AN_EXISTING_FI
aa60: 4c 45 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  LE ] ; then.    
aa70: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
aa80: 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 66 69      echo "The fi
aa90: 6c 65 20 70 61 74 68 20 22 0a 20 20 20 20 20 20  le path ".      
aaa0: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
aab0: 20 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46    echo "    $S_F
aac0: 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f  P_2_AN_EXISTING_
aad0: 46 49 4c 45 20 22 0a 20 20 20 20 20 20 20 20 65  FILE ".        e
aae0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
aaf0: 63 68 6f 20 22 72 65 66 65 72 65 6e 63 65 73 20  cho "references 
ab00: 61 20 66 6f 6c 64 65 72 2c 20 62 75 74 20 61 20  a folder, but a 
ab10: 66 69 6c 65 20 69 73 20 65 78 70 65 63 74 65 64  file is expected
ab20: 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
ab30: 22 47 55 49 44 3d 3d 27 65 65 62 31 62 62 33 35  "GUID=='eeb1bb35
ab40: 2d 62 62 38 33 2d 34 39 66 39 2d 38 32 33 66 2d  -bb83-49f9-823f-
ab50: 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
ab60: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
ab70: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
ab80: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
ab90: 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
aba0: 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
abb0: 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
abc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
abd0: 2d 2d 2d 2d 0a 20 20 20 20 23 20 41 74 20 74 68  ----.    # At th
abe0: 69 73 20 6c 69 6e 65 20 74 68 65 20 76 65 72 69  is line the veri
abf0: 66 69 63 61 74 69 6f 6e 73 20 68 61 76 65 20 61  fications have a
ac00: 6c 6c 20 70 61 73 73 65 64 2e 0a 20 20 20 20 23  ll passed..    #
ac10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ac20: 2d 2d 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d  ----.} # func_mm
ac30: 6d 76 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e 63  mv_exc_hash_func
ac40: 74 69 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66  tion_input_verif
ac50: 69 63 61 74 69 6f 6e 5f 74 31 0a 0a 0a 23 2d 2d  ication_t1...#--
ac60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ac70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ac80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ac90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
aca0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43  --------..S_FUNC
acb0: 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45  _MMMV_GUID_T1_RE
acc0: 53 55 4c 54 3d 22 6e 6f 74 5f 79 65 74 5f 73 65  SULT="not_yet_se
acd0: 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47  t".S_FUNC_MMMV_G
ace0: 55 49 44 5f 54 31 5f 4d 4f 44 45 3d 22 22 20 23  UID_T1_MODE="" #
acf0: 20 6f 70 74 69 6d 2e 20 74 6f 20 73 6b 69 70 20   optim. to skip 
ad00: 72 65 70 65 61 74 69 6e 67 20 63 6f 6e 73 6f 6c  repeating consol
ad10: 65 20 74 6f 6f 6c 20 73 65 6c 65 63 74 69 6f 6e  e tool selection
ad20: 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f  .func_mmmv_GUID_
ad30: 74 31 28 29 20 7b 20 0a 20 20 20 20 23 20 44 6f  t1() { .    # Do
ad40: 65 73 20 6e 6f 74 20 74 61 6b 65 20 61 6e 79 20  es not take any 
ad50: 61 72 67 75 6d 65 6e 74 73 2e 0a 20 20 20 20 23  arguments..    #
ad60: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 66 75  --------.    #fu
ad70: 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73 68  nc_mmmv_exc_hash
ad80: 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74 5f  _function_input_
ad90: 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31 20  verification_t1 
ada0: 22 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f  "func_mmmv_GUID_
adb0: 74 31 22 20 22 24 31 22 0a 20 20 20 20 23 2d 2d  t1" "$1".    #--
adc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
add0: 2d 2d 0a 20 20 20 20 23 20 4d 6f 64 65 20 73 65  --.    # Mode se
ade0: 6c 65 63 74 69 6f 6e 3a 0a 20 20 20 20 69 66 20  lection:.    if 
adf0: 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  [ "$S_FUNC_MMMV_
ae00: 47 55 49 44 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d  GUID_T1_MODE" ==
ae10: 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20   "" ] ; then.   
ae20: 20 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f 4f       SB_EXISTS_O
ae30: 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
ae40: 3d 22 66 22 20 20 23 20 69 66 2d 62 6c 6f 63 6b  ="f"  # if-block
ae50: 20 69 6e 69 74 0a 20 20 20 20 20 20 20 20 23 2d   init.        #-
ae60: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
ae70: 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
ae80: 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
ae90: 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a  == "f" ] ; then.
aea0: 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
aeb0: 50 5f 30 3d 22 75 75 69 64 67 65 6e 22 20 23 20  P_0="uuidgen" # 
aec0: 4c 69 6e 75 78 20 76 65 72 73 69 6f 6e 0a 20 20  Linux version.  
aed0: 20 20 20 20 20 20 20 20 20 20 66 75 6e 63 5f 73            func_s
aee0: 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68  b_exists_on_path
aef0: 5f 74 31 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a  _t1 "$S_TMP_0" .
af00: 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 5b              if [
af10: 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
af20: 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
af30: 3d 3d 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a  == "t" ] ; then.
af40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
af50: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49   S_FUNC_MMMV_GUI
af60: 44 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d  D_T1_MODE="$S_TM
af70: 50 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20  P_0".           
af80: 20 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20   fi.        fi. 
af90: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
afa0: 20 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45       if [ "$SB_E
afb0: 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31  XISTS_ON_PATH_T1
afc0: 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20  _RESULT" == "f" 
afd0: 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20  ] ; then.       
afe0: 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 75 75       S_TMP_0="uu
aff0: 69 64 22 20 20 20 20 23 20 42 53 44 20 76 65 72  id"    # BSD ver
b000: 73 69 6f 6e 0a 20 20 20 20 20 20 20 20 20 20 20  sion.           
b010: 20 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f   func_sb_exists_
b020: 6f 6e 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54  on_path_t1 "$S_T
b030: 4d 50 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20  MP_0" .         
b040: 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49     if [ "$SB_EXI
b050: 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52  STS_ON_PATH_T1_R
b060: 45 53 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20  ESULT" == "t" ] 
b070: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
b080: 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d          S_FUNC_M
b090: 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 4d 4f 44 45  MMV_GUID_T1_MODE
b0a0: 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20  ="$S_TMP_0".    
b0b0: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
b0c0: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d     fi.        #-
b0d0: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20  -------.        
b0e0: 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d  if [ "$S_FUNC_MM
b0f0: 4d 56 5f 47 55 49 44 5f 54 31 5f 4d 4f 44 45 22  MV_GUID_T1_MODE"
b100: 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
b110: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
b120: 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
b130: 65 63 68 6f 20 22 41 6c 6c 20 6f 66 20 74 68 65  echo "All of the
b140: 20 47 55 49 44 20 67 65 6e 65 72 61 74 69 6f 6e   GUID generation
b150: 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73   implementations
b160: 20 74 68 61 74 20 74 68 69 73 20 73 63 72 69 70   that this scrip
b170: 74 20 22 20 0a 20 20 20 20 20 20 20 20 20 20 20  t " .           
b180: 20 65 63 68 6f 20 22 69 73 20 63 61 70 61 62 6c   echo "is capabl
b190: 65 20 6f 66 20 75 73 69 6e 67 20 28 75 75 69 64  e of using (uuid
b1a0: 67 65 6e 2c 20 75 75 69 64 29 20 22 0a 20 20 20  gen, uuid) ".   
b1b0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 61           echo "a
b1c0: 72 65 20 6d 69 73 73 69 6e 67 20 66 72 6f 6d 20  re missing from 
b1d0: 74 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20  the PATH.".     
b1e0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
b1f0: 44 3d 3d 27 32 30 36 66 34 38 31 34 2d 32 30 31  D=='206f4814-201
b200: 65 2d 34 61 32 66 2d 62 33 33 66 2d 38 30 32 30  e-4a2f-b33f-8020
b210: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
b220: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
b230: 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d             #----
b240: 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20  .            cd 
b250: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
b260: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
b270: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
b280: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
b290: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
b2a0: 20 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21       if [ "$?" !
b2b0: 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  = "0" ]; then.  
b2c0: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
b2d0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
b2e0: 68 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20  ho "This script 
b2f0: 69 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20 20  is flawed.".    
b300: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
b310: 49 44 3d 3d 27 62 62 31 35 30 39 31 33 2d 63 39  ID=='bb150913-c9
b320: 62 39 2d 34 39 39 64 2d 38 34 33 66 2d 38 30 32  b9-499d-843f-802
b330: 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
b340: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
b350: 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d              #---
b360: 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64  -.            cd
b370: 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
b380: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
b390: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
b3a0: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
b3b0: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
b3c0: 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
b3d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
b3e0: 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47     S_FUNC_MMMV_G
b3f0: 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22  UID_T1_RESULT=""
b400: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
b410: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69  ----------.    i
b420: 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d  f [ "$S_FUNC_MMM
b430: 56 5f 47 55 49 44 5f 54 31 5f 4d 4f 44 45 22 20  V_GUID_T1_MODE" 
b440: 3d 3d 20 22 75 75 69 64 67 65 6e 22 20 5d 3b 20  == "uuidgen" ]; 
b450: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54  then.        S_T
b460: 4d 50 5f 30 3d 22 60 75 75 69 64 67 65 6e 60 22  MP_0="`uuidgen`"
b470: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
b480: 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65  ?" != "0" ]; the
b490: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  n.            ec
b4a0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
b4b0: 20 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e 73    echo "The cons
b4c0: 6f 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ole application 
b4d0: 5c 22 75 75 69 64 67 65 6e 5c 22 20 22 0a 20 20  \"uuidgen\" ".  
b4e0: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
b4f0: 65 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65  exited with an e
b500: 72 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20  rror.".         
b510: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
b520: 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d         echo "---
b530: 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74  -console--output
b540: 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72  --citation--star
b550: 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20  t-----".        
b560: 20 20 20 20 65 63 68 6f 20 22 60 75 75 69 64 67      echo "`uuidg
b570: 65 6e 60 22 20 23 20 73 74 64 6f 75 74 20 61 6e  en`" # stdout an
b580: 64 20 73 74 64 65 72 72 0a 20 20 20 20 20 20 20  d stderr.       
b590: 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63       echo "----c
b5a0: 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d  onsole--output--
b5b0: 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d  citation--end---
b5c0: 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20  ----".          
b5d0: 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
b5e0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
b5f0: 3d 3d 27 65 64 61 37 30 35 34 34 2d 34 64 62 66  =='eda70544-4dbf
b600: 2d 34 63 62 37 2d 61 31 33 66 2d 38 30 32 30 37  -4cb7-a13f-80207
b610: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
b620: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
b630: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
b640: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
b650: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
b660: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
b670: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
b680: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
b690: 20 20 23 2d 2d 2d 2d 20 0a 20 20 20 20 20 20 20    #---- .       
b6a0: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49   S_FUNC_MMMV_GUI
b6b0: 44 5f 54 31 5f 52 45 53 55 4c 54 3d 22 24 53 5f  D_T1_RESULT="$S_
b6c0: 54 4d 50 5f 30 22 0a 20 20 20 20 66 69 0a 20 20  TMP_0".    fi.  
b6d0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
b6e0: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
b6f0: 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47   "$S_FUNC_MMMV_G
b700: 55 49 44 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20  UID_T1_MODE" == 
b710: 22 75 75 69 64 22 20 5d 3b 20 74 68 65 6e 0a 20  "uuid" ]; then. 
b720: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
b730: 60 75 75 69 64 60 22 0a 20 20 20 20 20 20 20 20  `uuid`".        
b740: 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22  if [ "$?" != "0"
b750: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
b760: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
b770: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
b780: 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c 69  he console appli
b790: 63 61 74 69 6f 6e 20 5c 22 75 75 69 64 5c 22 20  cation \"uuid\" 
b7a0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
b7b0: 68 6f 20 22 65 78 69 74 65 64 20 77 69 74 68 20  ho "exited with 
b7c0: 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20 20 20 20  an error.".     
b7d0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
b7e0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
b7f0: 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75  "----console--ou
b800: 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d  tput--citation--
b810: 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20  start-----".    
b820: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 60 75          echo "`u
b830: 75 69 64 60 22 20 23 20 73 74 64 6f 75 74 20 61  uid`" # stdout a
b840: 6e 64 20 73 74 64 65 72 72 0a 20 20 20 20 20 20  nd stderr.      
b850: 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d        echo "----
b860: 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d  console--output-
b870: 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d  -citation--end--
b880: 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20  -----".         
b890: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
b8a0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
b8b0: 44 3d 3d 27 65 32 30 39 34 37 33 61 2d 39 36 62  D=='e209473a-96b
b8c0: 61 2d 34 31 64 66 2d 62 32 33 66 2d 38 30 32 30  a-41df-b23f-8020
b8d0: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
b8e0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
b8f0: 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d             #----
b900: 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20  .            cd 
b910: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
b920: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
b930: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
b940: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
b950: 20 20 20 23 2d 2d 2d 2d 20 0a 20 20 20 20 20 20     #---- .      
b960: 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55    S_FUNC_MMMV_GU
b970: 49 44 5f 54 31 5f 52 45 53 55 4c 54 3d 22 24 53  ID_T1_RESULT="$S
b980: 5f 54 4d 50 5f 30 22 0a 20 20 20 20 66 69 0a 20  _TMP_0".    fi. 
b990: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
b9a0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54  --------.    # T
b9b0: 68 65 20 72 65 61 73 6f 6e 2c 20 77 68 79 20 65  he reason, why e
b9c0: 76 65 72 79 74 68 69 6e 67 20 69 73 20 64 6f 6e  verything is don
b9d0: 65 20 77 69 74 68 20 72 75 62 79 20 61 74 20 74  e with ruby at t
b9e0: 68 65 20 6e 65 78 74 20 0a 20 20 20 20 23 20 42  he next .    # B
b9f0: 61 73 68 20 61 73 73 69 67 6e 6d 65 6e 74 20 63  ash assignment c
ba00: 6c 61 75 73 65 20 69 73 20 74 68 61 74 20 74 68  lause is that th
ba10: 65 20 22 77 63 20 2d 6d 22 20 70 61 64 73 20 69  e "wc -m" pads i
ba20: 74 73 20 6f 75 74 70 75 74 0a 20 20 20 20 23 20  ts output.    # 
ba30: 77 69 74 68 20 73 70 61 63 65 73 20 6f 6e 20 42  with spaces on B
ba40: 53 44 2e 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d  SD..    S_TMP_0=
ba50: 22 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69 6e  "`ruby -e \"prin
ba60: 74 28 41 52 47 56 5b 30 5d 2e 74 6f 5f 73 2e 6c  t(ARGV[0].to_s.l
ba70: 65 6e 67 74 68 2e 74 6f 5f 73 29 3b 5c 22 20 24  ength.to_s);\" $
ba80: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44  S_FUNC_MMMV_GUID
ba90: 5f 54 31 5f 52 45 53 55 4c 54 20 60 22 0a 20 20  _T1_RESULT `".  
baa0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
bab0: 53 5f 54 4d 50 5f 31 3d 22 33 36 22 0a 20 20 20  S_TMP_1="36".   
bac0: 20 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22   if [ "$S_TMP_0"
bad0: 20 21 3d 20 22 24 53 5f 54 4d 50 5f 31 22 20 5d   != "$S_TMP_1" ]
bae0: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
baf0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
bb00: 63 68 6f 20 22 41 63 63 6f 72 64 69 6e 67 20 74  cho "According t
bb10: 6f 20 74 68 65 20 47 55 49 44 20 73 70 65 63 69  o the GUID speci
bb20: 66 69 63 61 74 69 6f 6e 2c 20 49 45 54 46 20 52  fication, IETF R
bb30: 46 43 20 34 31 32 32 2c 20 20 22 0a 20 20 20 20  FC 4122,  ".    
bb40: 20 20 20 20 65 63 68 6f 20 22 74 68 65 20 6c 65      echo "the le
bb50: 6e 67 74 68 20 6f 66 20 74 68 65 20 47 55 49 44  ngth of the GUID
bb60: 20 69 73 20 22 0a 20 20 20 20 20 20 20 20 65 63   is ".        ec
bb70: 68 6f 20 22 24 53 5f 54 4d 50 5f 31 20 63 68 61  ho "$S_TMP_1 cha
bb80: 72 61 63 74 65 72 73 2c 20 62 75 74 20 74 68 65  racters, but the
bb90: 20 72 65 73 75 6c 74 20 6f 66 20 74 68 65 20 22   result of the "
bba0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
bbb0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
bbc0: 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49     func_mmmv_GUI
bbd0: 44 5f 74 31 22 0a 20 20 20 20 20 20 20 20 65 63  D_t1".        ec
bbe0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
bbf0: 68 6f 20 22 69 73 20 73 6f 6d 65 74 68 69 6e 67  ho "is something
bc00: 20 65 6c 73 65 2e 20 54 68 65 20 66 6c 61 77 65   else. The flawe
bc10: 64 20 47 55 49 44 20 63 61 6e 64 69 64 61 74 65  d GUID candidate
bc20: 20 69 6e 20 70 61 72 65 6e 74 68 65 73 69 73 3a   in parenthesis:
bc30: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
bc40: 28 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55  ($S_FUNC_MMMV_GU
bc50: 49 44 5f 54 31 5f 52 45 53 55 4c 54 29 22 0a 20  ID_T1_RESULT)". 
bc60: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
bc70: 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
bc80: 20 6c 65 6e 67 74 68 20 63 61 6e 64 69 64 61 74   length candidat
bc90: 65 20 6f 66 20 74 68 65 20 66 6c 61 77 65 64 20  e of the flawed 
bca0: 47 55 49 44 20 63 61 6e 64 69 64 61 74 65 20 69  GUID candidate i
bcb0: 6e 20 70 61 72 65 6e 74 68 65 73 69 73 3a 22 0a  n parenthesis:".
bcc0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 28 24          echo "($
bcd0: 53 5f 54 4d 50 5f 30 29 2e 22 0a 20 20 20 20 20  S_TMP_0).".     
bce0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
bcf0: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
bd00: 61 33 37 65 35 34 31 30 2d 32 30 37 64 2d 34 33  a37e5410-207d-43
bd10: 34 39 2d 39 35 33 66 2d 38 30 32 30 37 30 65 30  49-953f-802070e0
bd20: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
bd30: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
bd40: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
bd50: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
bd60: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
bd70: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
bd80: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
bd90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23  ------------.} #
bda0: 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f   func_mmmv_GUID_
bdb0: 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  t1...#----------
bdc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bdd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bde0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
bdf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
be00: 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48  ..S_FUNC_MMMV_SH
be10: 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54 3d 22  A256_T1_RESULT="
be20: 6e 6f 74 5f 79 65 74 5f 73 65 74 22 0a 53 5f 46  not_yet_set".S_F
be30: 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f  UNC_MMMV_SHA256_
be40: 54 31 5f 4d 4f 44 45 3d 22 22 20 23 20 6f 70 74  T1_MODE="" # opt
be50: 69 6d 2e 20 74 6f 20 73 6b 69 70 20 72 65 70 65  im. to skip repe
be60: 61 74 69 6e 67 20 63 6f 6e 73 6f 6c 65 20 74 6f  ating console to
be70: 6f 6c 20 73 65 6c 65 63 74 69 6f 6e 0a 66 75 6e  ol selection.fun
be80: 63 5f 6d 6d 6d 76 5f 73 68 61 32 35 36 5f 74 31  c_mmmv_sha256_t1
be90: 28 29 20 7b 20 23 20 72 65 71 75 69 72 65 73 20  () { # requires 
bea0: 61 6c 73 6f 20 72 75 62 79 20 61 6e 64 20 67 61  also ruby and ga
beb0: 77 6b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  wk .    local S_
bec0: 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
bed0: 5f 46 49 4c 45 3d 22 24 31 22 20 23 20 66 69 72  _FILE="$1" # fir
bee0: 73 74 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75  st function argu
bef0: 6d 65 6e 74 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  ment.    #------
bf00: 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  --.    func_mmmv
bf10: 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69  _exc_hash_functi
bf20: 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63  on_input_verific
bf30: 61 74 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d  ation_t1 "func_m
bf40: 6d 6d 76 5f 73 68 61 32 35 36 5f 74 31 22 20 22  mmv_sha256_t1" "
bf50: 24 31 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  $1".    #-------
bf60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
bf70: 20 20 23 20 4d 6f 64 65 20 73 65 6c 65 63 74 69    # Mode selecti
bf80: 6f 6e 3a 0a 20 20 20 20 69 66 20 5b 20 22 24 53  on:.    if [ "$S
bf90: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35  _FUNC_MMMV_SHA25
bfa0: 36 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 22  6_T1_MODE" == ""
bfb0: 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20   ] ; then.      
bfc0: 20 20 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50    SB_EXISTS_ON_P
bfd0: 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 66  ATH_T1_RESULT="f
bfe0: 22 20 20 23 20 69 66 2d 62 6c 6f 63 6b 20 69 6e  "  # if-block in
bff0: 69 74 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  it.        #----
c000: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
c010: 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54  SB_EXISTS_ON_PAT
c020: 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20  H_T1_RESULT" == 
c030: 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20  "f" ] ; then.   
c040: 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30           S_TMP_0
c050: 3d 22 73 68 61 32 35 36 73 75 6d 22 20 23 20 75  ="sha256sum" # u
c060: 73 75 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65  sually available
c070: 20 6f 6e 20 4c 69 6e 75 78 0a 20 20 20 20 20 20   on Linux.      
c080: 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78        func_sb_ex
c090: 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20  ists_on_path_t1 
c0a0: 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20 20  "$S_TMP_0" .    
c0b0: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 53          if [ "$S
c0c0: 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48  B_EXISTS_ON_PATH
c0d0: 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20 22  _T1_RESULT" == "
c0e0: 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20  t" ] ; then.    
c0f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 46               S_F
c100: 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f  UNC_MMMV_SHA256_
c110: 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f  T1_MODE="$S_TMP_
c120: 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  0".            f
c130: 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  i.        fi.   
c140: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
c150: 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49     if [ "$SB_EXI
c160: 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52  STS_ON_PATH_T1_R
c170: 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d 20  ESULT" == "f" ] 
c180: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
c190: 20 20 20 53 5f 54 4d 50 5f 30 3d 22 72 68 61 73     S_TMP_0="rhas
c1a0: 68 22 20 20 20 20 23 20 70 61 72 74 20 6f 66 20  h"    # part of 
c1b0: 74 68 65 20 42 53 44 20 70 61 63 6b 61 67 65 20  the BSD package 
c1c0: 63 6f 6c 6c 65 63 74 69 6f 6e 20 69 6e 20 32 30  collection in 20
c1d0: 31 36 0a 20 20 20 20 20 20 20 20 20 20 20 20 66  16.            f
c1e0: 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e  unc_sb_exists_on
c1f0: 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d 50  _path_t1 "$S_TMP
c200: 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20 20 20  _0" .           
c210: 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54   if [ "$SB_EXIST
c220: 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53  S_ON_PATH_T1_RES
c230: 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20  ULT" == "t" ] ; 
c240: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
c250: 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d        S_FUNC_MMM
c260: 56 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45  V_SHA256_T1_MODE
c270: 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20  ="$S_TMP_0".    
c280: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
c290: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d     fi.        #-
c2a0: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
c2b0: 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
c2c0: 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
c2d0: 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a  == "f" ] ; then.
c2e0: 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
c2f0: 50 5f 30 3d 22 73 68 61 32 35 36 22 20 20 20 20  P_0="sha256"    
c300: 23 20 75 73 75 61 6c 6c 79 20 61 76 61 69 6c 61  # usually availa
c310: 62 6c 65 20 6f 6e 20 42 53 44 0a 20 20 20 20 20  ble on BSD.     
c320: 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65         func_sb_e
c330: 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31  xists_on_path_t1
c340: 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20 20   "$S_TMP_0" .   
c350: 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24           if [ "$
c360: 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54  SB_EXISTS_ON_PAT
c370: 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d 20  H_T1_RESULT" == 
c380: 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20  "t" ] ; then.   
c390: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 5f                S_
c3a0: 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36  FUNC_MMMV_SHA256
c3b0: 5f 54 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50  _T1_MODE="$S_TMP
c3c0: 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
c3d0: 66 69 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  fi.        fi.  
c3e0: 20 20 20 20 20 20 23 20 54 68 65 20 63 6f 6e 73        # The cons
c3f0: 6f 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ole application 
c400: 22 72 68 61 73 68 22 20 69 73 20 70 72 65 66 65  "rhash" is prefe
c410: 72 72 65 64 20 74 6f 20 74 68 65 20 22 73 68 61  rred to the "sha
c420: 32 35 36 22 0a 20 20 20 20 20 20 20 20 23 20 62  256".        # b
c430: 65 63 61 75 73 65 20 74 68 65 20 22 72 68 61 73  ecause the "rhas
c440: 68 22 20 6f 75 74 70 75 74 20 63 61 6e 20 62 65  h" output can be
c450: 20 73 69 6d 70 6c 79 20 70 72 6f 63 65 73 73 65   simply processe
c460: 64 20 77 69 74 68 20 0a 20 20 20 20 20 20 20 20  d with .        
c470: 23 20 22 67 61 77 6b 22 2c 20 77 68 69 63 68 20  # "gawk", which 
c480: 74 61 6b 65 73 20 6f 76 65 72 20 35 78 20 6c 65  takes over 5x le
c490: 73 73 20 6d 65 6d 6f 72 79 20 74 68 61 6e 20 74  ss memory than t
c4a0: 68 65 20 52 75 62 79 20 69 6e 74 65 72 70 72 65  he Ruby interpre
c4b0: 74 65 72 2c 0a 20 20 20 20 20 20 20 20 23 20 6e  ter,.        # n
c4c0: 6f 74 20 74 6f 20 6d 65 6e 74 69 6f 6e 20 74 68  ot to mention th
c4d0: 65 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e  e initialization
c4e0: 20 63 6f 73 74 20 6f 66 20 74 68 65 20 52 75 62   cost of the Rub
c4f0: 79 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0a 20  y interpreter.. 
c500: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d         #--------
c510: 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
c520: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32  S_FUNC_MMMV_SHA2
c530: 35 36 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22  56_T1_MODE" == "
c540: 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20 20 20 20  " ] ; then.     
c550: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
c560: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
c570: 22 41 6c 6c 20 6f 66 20 74 68 65 20 53 48 41 2d  "All of the SHA-
c580: 32 35 36 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69  256 implementati
c590: 6f 6e 73 20 74 68 61 74 20 74 68 69 73 20 73 63  ons that this sc
c5a0: 72 69 70 74 20 22 20 0a 20 20 20 20 20 20 20 20  ript " .        
c5b0: 20 20 20 20 65 63 68 6f 20 22 69 73 20 63 61 70      echo "is cap
c5c0: 61 62 6c 65 20 6f 66 20 75 73 69 6e 67 20 28 73  able of using (s
c5d0: 68 61 32 35 36 73 75 6d 2c 20 72 68 61 73 68 2c  ha256sum, rhash,
c5e0: 20 73 68 61 32 35 36 29 20 22 0a 20 20 20 20 20   sha256) ".     
c5f0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 61 72 65         echo "are
c600: 20 6d 69 73 73 69 6e 67 20 66 72 6f 6d 20 74 68   missing from th
c610: 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20 20  e PATH.".       
c620: 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
c630: 3d 27 64 30 62 64 61 35 62 35 2d 61 66 65 33 2d  ='d0bda5b5-afe3-
c640: 34 64 39 38 2d 61 33 33 66 2d 38 30 32 30 37 30  4d98-a33f-802070
c650: 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
c660: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
c670: 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
c680: 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
c690: 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
c6a0: 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
c6b0: 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
c6c0: 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
c6d0: 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20   #--------.     
c6e0: 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20     if [ "$?" != 
c6f0: 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "0" ]; then.    
c700: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
c710: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
c720: 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69 73   "This script is
c730: 20 66 6c 61 77 65 64 2e 22 0a 20 20 20 20 20 20   flawed.".      
c740: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
c750: 3d 3d 27 38 64 62 65 30 64 35 62 2d 34 39 64 39  =='8dbe0d5b-49d9
c760: 2d 34 66 66 31 2d 39 31 32 66 2d 38 30 32 30 37  -4ff1-912f-80207
c770: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
c780: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
c790: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
c7a0: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
c7b0: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
c7c0: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
c7d0: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
c7e0: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
c7f0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
c800: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
c810: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20  ------------.   
c820: 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41   S_FUNC_MMMV_SHA
c830: 32 35 36 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22  256_T1_RESULT=""
c840: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
c850: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69  ----------.    i
c860: 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d  f [ "$S_FUNC_MMM
c870: 56 5f 53 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45  V_SHA256_T1_MODE
c880: 22 20 3d 3d 20 22 73 68 61 32 35 36 73 75 6d 22  " == "sha256sum"
c890: 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
c8a0: 20 53 5f 54 4d 50 5f 30 3d 22 60 73 68 61 32 35   S_TMP_0="`sha25
c8b0: 36 73 75 6d 20 24 53 5f 46 50 5f 32 5f 41 4e 5f  6sum $S_FP_2_AN_
c8c0: 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e  EXISTING_FILE 2>
c8d0: 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20  /dev/null`".    
c8e0: 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d      if [ "$?" !=
c8f0: 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "0" ]; then.   
c900: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
c910: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
c920: 6f 20 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61  o "The console a
c930: 70 70 6c 69 63 61 74 69 6f 6e 20 5c 22 73 68 61  pplication \"sha
c940: 32 35 36 73 75 6d 5c 22 20 22 0a 20 20 20 20 20  256sum\" ".     
c950: 20 20 20 20 20 20 20 65 63 68 6f 20 22 65 78 69         echo "exi
c960: 74 65 64 20 77 69 74 68 20 61 6e 20 65 72 72 6f  ted with an erro
c970: 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  r.".            
c980: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
c990: 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f      echo "----co
c9a0: 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63  nsole--output--c
c9b0: 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d 2d  itation--start--
c9c0: 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20  ---".           
c9d0: 20 65 63 68 6f 20 22 60 73 68 61 32 35 36 73 75   echo "`sha256su
c9e0: 6d 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49  m $S_FP_2_AN_EXI
c9f0: 53 54 49 4e 47 5f 46 49 4c 45 60 22 20 23 20 73  STING_FILE`" # s
ca00: 74 64 6f 75 74 20 61 6e 64 20 73 74 64 65 72 72  tdout and stderr
ca10: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
ca20: 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d  o "----console--
ca30: 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e  output--citation
ca40: 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20  --end-------".  
ca50: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
ca60: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
ca70: 68 6f 20 22 47 55 49 44 3d 3d 27 62 65 63 61 38  ho "GUID=='beca8
ca80: 35 31 30 2d 64 61 61 33 2d 34 65 35 64 2d 39 35  510-daa3-4e5d-95
ca90: 32 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  2f-802070e031e7'
caa0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
cab0: 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20  ho "".          
cac0: 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
cad0: 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
cae0: 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78  G.            ex
caf0: 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
cb00: 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66   error.        f
cb10: 69 0a 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43  i.        S_FUNC
cb20: 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f  _MMMV_SHA256_T1_
cb30: 52 45 53 55 4c 54 3d 22 60 72 75 62 79 20 2d 65  RESULT="`ruby -e
cb40: 20 5c 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d   \"print(ARGV[0]
cb50: 29 3b 5c 22 20 24 53 5f 54 4d 50 5f 30 20 60 22  );\" $S_TMP_0 `"
cb60: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
cb70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
cb80: 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46  -.    if [ "$S_F
cb90: 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32 35 36 5f  UNC_MMMV_SHA256_
cba0: 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 72 68 61  T1_MODE" == "rha
cbb0: 73 68 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  sh" ]; then.    
cbc0: 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72 68      S_TMP_0="`rh
cbd0: 61 73 68 20 2d 2d 73 68 61 32 35 36 20 24 53 5f  ash --sha256 $S_
cbe0: 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
cbf0: 5f 46 49 4c 45 20 32 3e 2f 64 65 76 2f 6e 75 6c  _FILE 2>/dev/nul
cc00: 6c 60 22 0a 20 20 20 20 20 20 20 20 69 66 20 5b  l`".        if [
cc10: 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20   "$?" != "0" ]; 
cc20: 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
cc30: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
cc40: 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 63       echo "The c
cc50: 6f 6e 73 6f 6c 65 20 61 70 70 6c 69 63 61 74 69  onsole applicati
cc60: 6f 6e 20 5c 22 72 68 61 73 68 5c 22 20 22 0a 20  on \"rhash\" ". 
cc70: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
cc80: 22 65 78 69 74 65 64 20 77 69 74 68 20 61 6e 20  "exited with an 
cc90: 65 72 72 6f 72 2e 22 0a 20 20 20 20 20 20 20 20  error.".        
cca0: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
ccb0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d          echo "--
ccc0: 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75  --console--outpu
ccd0: 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61  t--citation--sta
cce0: 72 74 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20  rt-----".       
ccf0: 20 20 20 20 20 65 63 68 6f 20 22 60 72 68 61 73       echo "`rhas
cd00: 68 20 2d 2d 73 68 61 32 35 36 20 24 53 5f 46 50  h --sha256 $S_FP
cd10: 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
cd20: 49 4c 45 20 60 22 0a 20 20 20 20 20 20 20 20 20  ILE `".         
cd30: 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e     echo "----con
cd40: 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69  sole--output--ci
cd50: 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d  tation--end-----
cd60: 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  --".            
cd70: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
cd80: 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
cd90: 27 61 62 39 31 66 38 35 61 2d 65 63 39 38 2d 34  'ab91f85a-ec98-4
cda0: 35 30 30 2d 38 35 32 66 2d 38 30 32 30 37 30 65  500-852f-802070e
cdb0: 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
cdc0: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
cdd0: 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
cde0: 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
cdf0: 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
ce00: 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
ce10: 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
ce20: 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
ce30: 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48 41 32  S_FUNC_MMMV_SHA2
ce40: 35 36 5f 54 31 5f 52 45 53 55 4c 54 3d 22 60 72  56_T1_RESULT="`r
ce50: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41  uby -e \"print(A
ce60: 52 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f 54 4d  RGV[0]);\" $S_TM
ce70: 50 5f 30 20 60 22 0a 20 20 20 20 66 69 0a 20 20  P_0 `".    fi.  
ce80: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
ce90: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
cea0: 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53   "$S_FUNC_MMMV_S
ceb0: 48 41 32 35 36 5f 54 31 5f 4d 4f 44 45 22 20 3d  HA256_T1_MODE" =
cec0: 3d 20 22 73 68 61 32 35 36 22 20 5d 3b 20 74 68  = "sha256" ]; th
ced0: 65 6e 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  en.        #----
cee0: 0a 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f  .        S_FUNC_
cef0: 4d 4d 4d 56 5f 53 48 41 32 35 36 5f 54 31 5f 52  MMMV_SHA256_T1_R
cf00: 45 53 55 4c 54 3d 5c 0a 20 20 20 20 20 20 20 20  ESULT=\.        
cf10: 22 60 53 5f 54 4d 50 5f 30 3d 5c 22 5c 60 73 68  "`S_TMP_0=\"\`sh
cf20: 61 32 35 36 20 24 53 5f 46 50 5f 32 5f 41 4e 5f  a256 $S_FP_2_AN_
cf30: 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 5c 60 5c  EXISTING_FILE\`\
cf40: 22 20 72 75 62 79 20 2d 65 20 5c 22 73 30 3d 45  " ruby -e \"s0=E
cf50: 4e 56 5b 27 53 5f 54 4d 50 5f 30 27 5d 2e 74 6f  NV['S_TMP_0'].to
cf60: 5f 73 3b 69 78 5f 30 3d 73 30 2e 69 6e 64 65 78  _s;ix_0=s0.index
cf70: 28 27 29 20 3d 20 27 29 3b 70 72 69 6e 74 20 73  (') = ');print s
cf80: 30 5b 28 69 78 5f 30 2b 34 29 2e 2e 28 2d 31 29  0[(ix_0+4)..(-1)
cf90: 5d 5c 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60  ]\" 2>/dev/null`
cfa0: 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
cfb0: 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 3f          if [ "$?
cfc0: 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e  " != "0" ]; then
cfd0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
cfe0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
cff0: 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e 73 6f   echo "The conso
d000: 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 5c  le application \
d010: 22 73 68 61 32 35 36 5c 22 20 22 0a 20 20 20 20  "sha256\" ".    
d020: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65 78          echo "ex
d030: 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72 72  ited with an err
d040: 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  or.".           
d050: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
d060: 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63       echo "----c
d070: 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d  onsole--output--
d080: 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d  citation--start-
d090: 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20  ----".          
d0a0: 20 20 65 63 68 6f 20 5c 0a 20 20 20 20 20 20 20    echo \.       
d0b0: 20 20 20 20 20 22 60 53 5f 54 4d 50 5f 30 3d 5c       "`S_TMP_0=\
d0c0: 22 5c 60 73 68 61 32 35 36 20 24 53 5f 46 50 5f  "\`sha256 $S_FP_
d0d0: 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49  2_AN_EXISTING_FI
d0e0: 4c 45 5c 60 5c 22 20 72 75 62 79 20 2d 65 20 5c  LE\`\" ruby -e \
d0f0: 22 73 30 3d 45 4e 56 5b 27 53 5f 54 4d 50 5f 30  "s0=ENV['S_TMP_0
d100: 27 5d 2e 74 6f 5f 73 3b 69 78 5f 30 3d 73 30 2e  '].to_s;ix_0=s0.
d110: 69 6e 64 65 78 28 27 29 20 3d 20 27 29 3b 70 72  index(') = ');pr
d120: 69 6e 74 20 73 30 5b 28 69 78 5f 30 2b 34 29 2e  int s0[(ix_0+4).
d130: 2e 28 2d 31 29 5d 5c 22 60 22 0a 20 20 20 20 20  .(-1)]\"`".     
d140: 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d         echo "---
d150: 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74  -console--output
d160: 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64 2d  --citation--end-
d170: 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20  ------".        
d180: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
d190: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
d1a0: 49 44 3d 3d 27 66 39 36 32 62 66 32 64 2d 63 63  ID=='f962bf2d-cc
d1b0: 30 30 2d 34 39 62 30 2d 39 32 32 66 2d 38 30 32  00-49b0-922f-802
d1c0: 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
d1d0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
d1e0: 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d              #---
d1f0: 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64  -.            cd
d200: 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
d210: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
d220: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
d230: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
d240: 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
d250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20  ------------.   
d260: 20 23 20 54 68 65 20 72 65 61 73 6f 6e 2c 20 77   # The reason, w
d270: 68 79 20 65 76 65 72 79 74 68 69 6e 67 20 69 73  hy everything is
d280: 20 64 6f 6e 65 20 77 69 74 68 20 72 75 62 79 20   done with ruby 
d290: 61 74 20 74 68 65 20 6e 65 78 74 20 0a 20 20 20  at the next .   
d2a0: 20 23 20 42 61 73 68 20 61 73 73 69 67 6e 6d 65   # Bash assignme
d2b0: 6e 74 20 63 6c 61 75 73 65 20 69 73 20 74 68 61  nt clause is tha
d2c0: 74 20 74 68 65 20 22 77 63 20 2d 6d 22 20 70 61  t the "wc -m" pa
d2d0: 64 73 20 69 74 73 20 6f 75 74 70 75 74 0a 20 20  ds its output.  
d2e0: 20 20 23 20 77 69 74 68 20 73 70 61 63 65 73 20    # with spaces 
d2f0: 6f 6e 20 42 53 44 2e 0a 20 20 20 20 53 5f 54 4d  on BSD..    S_TM
d300: 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22  P_0="`ruby -e \"
d310: 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 2e 74 6f  print(ARGV[0].to
d320: 5f 73 2e 6c 65 6e 67 74 68 2e 74 6f 5f 73 29 3b  _s.length.to_s);
d330: 5c 22 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  \" $S_FUNC_MMMV_
d340: 53 48 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54  SHA256_T1_RESULT
d350: 20 60 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d   `".    #-------
d360: 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22 36  -.    S_TMP_1="6
d370: 34 22 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  4".    if [ "$S_
d380: 54 4d 50 5f 30 22 20 21 3d 20 22 24 53 5f 54 4d  TMP_0" != "$S_TM
d390: 50 5f 31 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  P_1" ]; then.   
d3a0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
d3b0: 20 20 20 20 20 65 63 68 6f 20 22 41 63 63 6f 72       echo "Accor
d3c0: 64 69 6e 67 20 74 6f 20 74 68 65 20 73 70 65 63  ding to the spec
d3d0: 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 74 68 65  ification of the
d3e0: 20 53 48 41 2d 32 35 36 20 68 61 73 68 20 61 6c   SHA-256 hash al
d3f0: 67 6f 72 69 74 68 6d 22 0a 20 20 20 20 20 20 20  gorithm".       
d400: 20 65 63 68 6f 20 22 74 68 65 20 6c 65 6e 67 74   echo "the lengt
d410: 68 20 6f 66 20 74 68 65 20 53 48 41 2d 32 35 36  h of the SHA-256
d420: 20 68 61 73 68 20 69 73 20 22 0a 20 20 20 20 20   hash is ".     
d430: 20 20 20 65 63 68 6f 20 22 24 53 5f 54 4d 50 5f     echo "$S_TMP_
d440: 31 20 68 65 78 61 64 65 63 69 6d 61 6c 20 63 68  1 hexadecimal ch
d450: 61 72 61 63 74 65 72 73 2c 20 62 75 74 20 74 68  aracters, but th
d460: 65 20 72 65 73 75 6c 74 20 6f 66 20 74 68 65 20  e result of the 
d470: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
d480: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
d490: 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 68      func_mmmv_sh
d4a0: 61 32 35 36 5f 74 31 22 0a 20 20 20 20 20 20 20  a256_t1".       
d4b0: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
d4c0: 20 65 63 68 6f 20 22 69 73 20 73 6f 6d 65 74 68   echo "is someth
d4d0: 69 6e 67 20 65 6c 73 65 2e 20 54 68 65 20 66 6c  ing else. The fl
d4e0: 61 77 65 64 20 68 61 73 68 20 63 61 6e 64 69 64  awed hash candid
d4f0: 61 74 65 20 69 6e 20 70 61 72 65 6e 74 68 65 73  ate in parenthes
d500: 69 73 3a 22 0a 20 20 20 20 20 20 20 20 65 63 68  is:".        ech
d510: 6f 20 22 28 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56  o "($S_FUNC_MMMV
d520: 5f 53 48 41 32 35 36 5f 54 31 5f 52 45 53 55 4c  _SHA256_T1_RESUL
d530: 54 29 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  T)".        echo
d540: 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
d550: 20 22 54 68 65 20 6c 65 6e 67 74 68 20 63 61 6e   "The length can
d560: 64 69 64 61 74 65 20 6f 66 20 74 68 65 20 66 6c  didate of the fl
d570: 61 77 65 64 20 68 61 73 68 20 63 61 6e 64 69 64  awed hash candid
d580: 61 74 65 20 69 6e 20 70 61 72 65 6e 74 68 65 73  ate in parenthes
d590: 69 73 3a 22 0a 20 20 20 20 20 20 20 20 65 63 68  is:".        ech
d5a0: 6f 20 22 28 24 53 5f 54 4d 50 5f 30 29 2e 22 0a  o "($S_TMP_0).".
d5b0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
d5c0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
d5d0: 49 44 3d 3d 27 34 33 61 37 34 39 35 31 2d 61 36  ID=='43a74951-a6
d5e0: 34 38 2d 34 38 63 36 2d 38 64 32 66 2d 38 30 32  48-48c6-8d2f-802
d5f0: 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
d600: 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
d610: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
d620: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
d630: 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
d640: 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
d650: 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
d660: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d670: 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f  -.} # func_mmmv_
d680: 73 68 61 32 35 36 5f 74 31 0a 0a 0a 23 2d 2d 2d  sha256_t1...#---
d690: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d6a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d6b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d6c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d6d0: 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43 5f  -------..S_FUNC_
d6e0: 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54  MMMV_TIGERHASH_T
d6f0: 31 5f 52 45 53 55 4c 54 3d 22 6e 6f 74 5f 79 65  1_RESULT="not_ye
d700: 74 5f 73 65 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d  t_set".S_FUNC_MM
d710: 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f  MV_TIGERHASH_T1_
d720: 4d 4f 44 45 3d 22 22 20 23 20 6f 70 74 69 6d 2e  MODE="" # optim.
d730: 20 74 6f 20 73 6b 69 70 20 72 65 70 65 61 74 69   to skip repeati
d740: 6e 67 20 63 6f 6e 73 6f 6c 65 20 74 6f 6f 6c 20  ng console tool 
d750: 73 65 6c 65 63 74 69 6f 6e 0a 66 75 6e 63 5f 6d  selection.func_m
d760: 6d 6d 76 5f 74 69 67 65 72 68 61 73 68 5f 74 31  mmv_tigerhash_t1
d770: 28 29 20 7b 20 23 20 72 65 71 75 69 72 65 73 20  () { # requires 
d780: 61 6c 73 6f 20 72 75 62 79 20 61 6e 64 20 67 61  also ruby and ga
d790: 77 6b 20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  wk .    local S_
d7a0: 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47  FP_2_AN_EXISTING
d7b0: 5f 46 49 4c 45 3d 22 24 31 22 20 23 20 66 69 72  _FILE="$1" # fir
d7c0: 73 74 20 66 75 6e 63 74 69 6f 6e 20 61 72 67 75  st function argu
d7d0: 6d 65 6e 74 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  ment.    #------
d7e0: 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54  --.    local S_T
d7f0: 4d 50 5f 30 20 23 20 64 65 63 6c 61 72 61 74 69  MP_0 # declarati
d800: 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54  on.    local S_T
d810: 4d 50 5f 31 20 23 20 64 65 63 6c 61 72 61 74 69  MP_1 # declarati
d820: 6f 6e 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  on.    func_mmmv
d830: 5f 65 78 63 5f 68 61 73 68 5f 66 75 6e 63 74 69  _exc_hash_functi
d840: 6f 6e 5f 69 6e 70 75 74 5f 76 65 72 69 66 69 63  on_input_verific
d850: 61 74 69 6f 6e 5f 74 31 20 22 66 75 6e 63 5f 6d  ation_t1 "func_m
d860: 6d 6d 76 5f 74 69 67 65 72 68 61 73 68 5f 74 31  mmv_tigerhash_t1
d870: 22 20 22 24 31 22 0a 20 20 20 20 23 2d 2d 2d 2d  " "$1".    #----
d880: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
d890: 0a 20 20 20 20 23 20 4d 6f 64 65 20 73 65 6c 65  .    # Mode sele
d8a0: 63 74 69 6f 6e 3a 0a 20 20 20 20 69 66 20 5b 20  ction:.    if [ 
d8b0: 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49  "$S_FUNC_MMMV_TI
d8c0: 47 45 52 48 41 53 48 5f 54 31 5f 4d 4f 44 45 22  GERHASH_T1_MODE"
d8d0: 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a   == "" ] ; then.
d8e0: 20 20 20 20 20 20 20 20 53 42 5f 45 58 49 53 54          SB_EXIST
d8f0: 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53  S_ON_PATH_T1_RES
d900: 55 4c 54 3d 22 66 22 20 20 23 20 69 66 2d 62 6c  ULT="f"  # if-bl
d910: 6f 63 6b 20 69 6e 69 74 0a 20 20 20 20 20 20 20  ock init.       
d920: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69   #----.        i
d930: 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f  f [ "$SB_EXISTS_
d940: 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c  ON_PATH_T1_RESUL
d950: 54 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68  T" == "f" ] ; th
d960: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53  en.            S
d970: 5f 54 4d 50 5f 30 3d 22 74 69 67 65 72 64 65 65  _TMP_0="tigerdee
d980: 70 22 20 23 20 75 73 75 61 6c 6c 79 20 61 76 61  p" # usually ava
d990: 69 6c 61 62 6c 65 20 6f 6e 20 4c 69 6e 75 78 0a  ilable on Linux.
d9a0: 20 20 20 20 20 20 20 20 20 20 20 20 66 75 6e 63              func
d9b0: 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61  _sb_exists_on_pa
d9c0: 74 68 5f 74 31 20 22 24 53 5f 54 4d 50 5f 30 22  th_t1 "$S_TMP_0"
d9d0: 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66   .            if
d9e0: 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f   [ "$SB_EXISTS_O
d9f0: 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
da00: 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20 74 68 65  " == "t" ] ; the
da10: 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  n.              
da20: 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54     S_FUNC_MMMV_T
da30: 49 47 45 52 48 41 53 48 5f 54 31 5f 4d 4f 44 45  IGERHASH_T1_MODE
da40: 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20  ="$S_TMP_0".    
da50: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
da60: 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d     fi.        #-
da70: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
da80: 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f   "$SB_EXISTS_ON_
da90: 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20  PATH_T1_RESULT" 
daa0: 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e 0a  == "f" ] ; then.
dab0: 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54 4d              S_TM
dac0: 50 5f 30 3d 22 72 68 61 73 68 22 20 20 20 20 23  P_0="rhash"    #
dad0: 20 70 61 72 74 20 6f 66 20 74 68 65 20 42 53 44   part of the BSD
dae0: 20 70 61 63 6b 61 67 65 20 63 6f 6c 6c 65 63 74   package collect
daf0: 69 6f 6e 20 69 6e 20 32 30 31 36 0a 20 20 20 20  ion in 2016.    
db00: 20 20 20 20 20 20 20 20 66 75 6e 63 5f 73 62 5f          func_sb_
db10: 65 78 69 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74  exists_on_path_t
db20: 31 20 22 24 53 5f 54 4d 50 5f 30 22 20 0a 20 20  1 "$S_TMP_0" .  
db30: 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20 22            if [ "
db40: 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e 5f 50 41  $SB_EXISTS_ON_PA
db50: 54 48 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d 3d  TH_T1_RESULT" ==
db60: 20 22 74 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20   "t" ] ; then.  
db70: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53                 S
db80: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52  _FUNC_MMMV_TIGER
db90: 48 41 53 48 5f 54 31 5f 4d 4f 44 45 3d 22 24 53  HASH_T1_MODE="$S
dba0: 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
dbb0: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 66      fi.        f
dbc0: 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d  i.        #-----
dbd0: 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b  ---.        if [
dbe0: 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54   "$S_FUNC_MMMV_T
dbf0: 49 47 45 52 48 41 53 48 5f 54 31 5f 4d 4f 44 45  IGERHASH_T1_MODE
dc00: 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e  " == "" ] ; then
dc10: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
dc20: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
dc30: 20 65 63 68 6f 20 22 41 6c 6c 20 6f 66 20 74 68   echo "All of th
dc40: 65 20 54 69 67 65 72 20 68 61 73 68 20 69 6d 70  e Tiger hash imp
dc50: 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 74 68 61  lementations tha
dc60: 74 20 74 68 69 73 20 73 63 72 69 70 74 20 22 20  t this script " 
dc70: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
dc80: 6f 20 22 69 73 20 63 61 70 61 62 6c 65 20 6f 66  o "is capable of
dc90: 20 75 73 69 6e 67 20 28 74 69 67 65 72 64 65 65   using (tigerdee
dca0: 70 2c 20 72 68 61 73 68 29 20 22 0a 20 20 20 20  p, rhash) ".    
dcb0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 61 72          echo "ar
dcc0: 65 20 6d 69 73 73 69 6e 67 20 66 72 6f 6d 20 74  e missing from t
dcd0: 68 65 20 50 41 54 48 2e 22 0a 20 20 20 20 20 20  he PATH.".      
dce0: 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
dcf0: 3d 3d 27 39 30 62 38 65 30 35 30 2d 36 30 35 65  =='90b8e050-605e
dd00: 2d 34 37 33 39 2d 61 31 32 66 2d 38 30 32 30 37  -4739-a12f-80207
dd10: 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
dd20: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
dd30: 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
dd40: 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
dd50: 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
dd60: 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
dd70: 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
dd80: 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
dd90: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
dda0: 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d      if [ "$?" !=
ddb0: 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "0" ]; then.   
ddc0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
ddd0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
dde0: 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69  o "This script i
ddf0: 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20 20 20  s flawed.".     
de00: 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
de10: 44 3d 3d 27 31 34 39 33 31 36 34 64 2d 37 66 33  D=='1493164d-7f3
de20: 39 2d 34 30 33 64 2d 61 35 32 66 2d 38 30 32 30  9-403d-a52f-8020
de30: 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
de40: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
de50: 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d             #----
de60: 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20  .            cd 
de70: 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
de80: 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
de90: 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
dea0: 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
deb0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
dec0: 20 20 20 20 20 66 75 6e 63 5f 73 62 5f 65 78 69       func_sb_exi
ded0: 73 74 73 5f 6f 6e 5f 70 61 74 68 5f 74 31 20 22  sts_on_path_t1 "
dee0: 72 75 62 79 22 20 0a 20 20 20 20 20 20 20 20 69  ruby" .        i
def0: 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f  f [ "$SB_EXISTS_
df00: 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c  ON_PATH_T1_RESUL
df10: 54 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68  T" == "f" ] ; th
df20: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
df30: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
df40: 20 20 20 65 63 68 6f 20 22 5c 22 72 75 62 79 5c     echo "\"ruby\
df50: 22 20 69 73 20 6d 69 73 73 69 6e 67 20 66 72 6f  " is missing fro
df60: 6d 20 74 68 65 20 50 41 54 48 2c 20 62 75 74 20  m the PATH, but 
df70: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
df80: 68 6f 20 22 74 68 69 73 20 66 75 6e 63 74 69 6f  ho "this functio
df90: 6e 20 72 65 71 75 69 72 65 73 20 74 68 61 74 20  n requires that 
dfa0: 69 74 20 69 73 20 6f 6e 20 74 68 65 20 50 41 54  it is on the PAT
dfb0: 48 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  H.".            
dfc0: 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 36 61 65  echo "GUID=='6ae
dfd0: 35 64 33 63 33 2d 38 31 37 32 2d 34 66 35 33 2d  5d3c3-8172-4f53-
dfe0: 61 34 32 66 2d 38 30 32 30 37 30 65 30 33 31 65  a42f-802070e031e
dff0: 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  7'".            
e000: 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
e010: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
e020: 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
e030: 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20  RIG.            
e040: 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
e050: 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20  th error.       
e060: 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   fi.        #---
e070: 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66  -----.        if
e080: 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d   [ "$?" != "0" ]
e090: 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
e0a0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
e0b0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69         echo "Thi
e0c0: 73 20 73 63 72 69 70 74 20 69 73 20 66 6c 61 77  s script is flaw
e0d0: 65 64 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  ed.".           
e0e0: 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 31 32   echo "GUID=='12
e0f0: 61 38 36 33 37 32 2d 39 63 31 35 2d 34 39 37 61  a86372-9c15-497a
e100: 2d 39 32 32 66 2d 38 30 32 30 37 30 65 30 33 31  -922f-802070e031
e110: 65 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20  e7'".           
e120: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
e130: 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
e140: 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
e150: 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20  ORIG.           
e160: 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
e170: 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20  ith error.      
e180: 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d    fi.        #--
e190: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 69 0a 20 20  ------.    fi.  
e1a0: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
e1b0: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 46 55  -------.    S_FU
e1c0: 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53  NC_MMMV_TIGERHAS
e1d0: 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22 0a 20  H_T1_RESULT="". 
e1e0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
e1f0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20  --------.    if 
e200: 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  [ "$S_FUNC_MMMV_
e210: 54 49 47 45 52 48 41 53 48 5f 54 31 5f 4d 4f 44  TIGERHASH_T1_MOD
e220: 45 22 20 3d 3d 20 22 74 69 67 65 72 64 65 65 70  E" == "tigerdeep
e230: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
e240: 20 20 53 5f 54 4d 50 5f 30 3d 22 60 74 69 67 65    S_TMP_0="`tige
e250: 72 64 65 65 70 20 24 53 5f 46 50 5f 32 5f 41 4e  rdeep $S_FP_2_AN
e260: 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 32  _EXISTING_FILE 2
e270: 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20  >/dev/null`".   
e280: 20 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21       if [ "$?" !
e290: 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  = "0" ]; then.  
e2a0: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
e2b0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
e2c0: 68 6f 20 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20  ho "The console 
e2d0: 61 70 70 6c 69 63 61 74 69 6f 6e 20 5c 22 74 69  application \"ti
e2e0: 67 65 72 64 65 65 70 5c 22 20 22 0a 20 20 20 20  gerdeep\" ".    
e2f0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65 78          echo "ex
e300: 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72 72  ited with an err
e310: 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  or.".           
e320: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
e330: 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63       echo "----c
e340: 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d  onsole--output--
e350: 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d  citation--start-
e360: 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20  ----".          
e370: 20 20 65 63 68 6f 20 22 60 74 69 67 65 72 64 65    echo "`tigerde
e380: 65 70 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  ep $S_FP_2_AN_EX
e390: 49 53 54 49 4e 47 5f 46 49 4c 45 60 22 20 23 20  ISTING_FILE`" # 
e3a0: 73 74 64 6f 75 74 20 61 6e 64 20 73 74 64 65 72  stdout and stder
e3b0: 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  r.            ec
e3c0: 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d  ho "----console-
e3d0: 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f  -output--citatio
e3e0: 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20  n--end-------". 
e3f0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
e400: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
e410: 63 68 6f 20 22 47 55 49 44 3d 3d 27 65 31 38 31  cho "GUID=='e181
e420: 66 62 32 32 2d 38 33 37 62 2d 34 33 61 31 2d 38  fb22-837b-43a1-8
e430: 35 31 66 2d 38 30 32 30 37 30 65 30 33 31 65 37  51f-802070e031e7
e440: 27 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  '".            e
e450: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
e460: 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
e470: 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
e480: 49 47 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  IG.            e
e490: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
e4a0: 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20  h error.        
e4b0: 66 69 0a 20 20 20 20 20 20 20 20 23 20 54 68 65  fi.        # The
e4c0: 20 22 74 69 67 65 72 64 65 65 70 22 20 72 65 74   "tigerdeep" ret
e4d0: 75 72 6e 73 20 61 20 73 69 6e 67 6c 65 20 6c 69  urns a single li
e4e0: 6e 65 20 74 68 61 74 20 68 61 73 20 74 68 65 20  ne that has the 
e4f0: 66 6f 72 6d 61 74 20 6f 66 20 0a 20 20 20 20 20  format of .     
e500: 20 20 20 23 0a 20 20 20 20 20 20 20 20 23 20 20     #.        #  
e510: 20 20 20 3c 74 68 65 20 68 61 73 68 3e 20 3c 70     <the hash> <p
e520: 61 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 3e  ath to the file>
e530: 0a 20 20 20 20 20 20 20 20 23 0a 20 20 20 20 20  .        #.     
e540: 20 20 20 23 20 54 68 65 20 66 6f 6c 6c 6f 77 69     # The followi
e550: 6e 67 20 6c 69 6e 65 20 69 73 20 74 6f 20 70 69  ng line is to pi
e560: 63 6b 20 74 68 65 20 66 69 72 73 74 20 63 6f 6c  ck the first col
e570: 75 6d 6e 20 66 72 6f 6d 20 74 68 61 74 20 6c 69  umn from that li
e580: 6e 65 2e 0a 20 20 20 20 20 20 20 20 53 5f 46 55  ne..        S_FU
e590: 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53  NC_MMMV_TIGERHAS
e5a0: 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 60 72 75  H_T1_RESULT="`ru
e5b0: 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41 52  by -e \"print(AR
e5c0: 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f 54 4d 50  GV[0]);\" $S_TMP
e5d0: 5f 30 60 22 0a 20 20 20 20 66 69 0a 20 20 20 20  _0`".    fi.    
e5e0: 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
e5f0: 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22  -----.    if [ "
e600: 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47  $S_FUNC_MMMV_TIG
e610: 45 52 48 41 53 48 5f 54 31 5f 4d 4f 44 45 22 20  ERHASH_T1_MODE" 
e620: 3d 3d 20 22 72 68 61 73 68 22 20 5d 3b 20 74 68  == "rhash" ]; th
e630: 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50  en.        S_TMP
e640: 5f 30 3d 22 60 72 68 61 73 68 20 2d 2d 74 69 67  _0="`rhash --tig
e650: 65 72 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  er $S_FP_2_AN_EX
e660: 49 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e 2f 64  ISTING_FILE 2>/d
e670: 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20  ev/null`".      
e680: 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22    if [ "$?" != "
e690: 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
e6a0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
e6b0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
e6c0: 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70  "The console app
e6d0: 6c 69 63 61 74 69 6f 6e 20 5c 22 72 68 61 73 68  lication \"rhash
e6e0: 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  \" ".           
e6f0: 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69   echo "exited wi
e700: 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20  th an error.".  
e710: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
e720: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
e730: 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d  ho "----console-
e740: 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f  -output--citatio
e750: 6e 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20  n--start-----". 
e760: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
e770: 22 60 72 68 61 73 68 20 2d 2d 74 69 67 65 72 20  "`rhash --tiger 
e780: 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54  $S_FP_2_AN_EXIST
e790: 49 4e 47 5f 46 49 4c 45 20 60 22 0a 20 20 20 20  ING_FILE `".    
e7a0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d 2d          echo "--
e7b0: 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75  --console--outpu
e7c0: 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e 64  t--citation--end
e7d0: 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20  -------".       
e7e0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
e7f0: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47           echo "G
e800: 55 49 44 3d 3d 27 61 33 33 63 38 32 33 62 2d 35  UID=='a33c823b-5
e810: 37 64 37 2d 34 63 64 30 2d 61 31 31 66 2d 38 30  7d7-4cd0-a11f-80
e820: 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  2070e031e7'".   
e830: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
e840: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 2d 2d  .            #--
e850: 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63  --.            c
e860: 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
e870: 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20           exit 1 
e880: 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
e890: 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20  r.        fi.   
e8a0: 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56       S_FUNC_MMMV
e8b0: 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f 52 45  _TIGERHASH_T1_RE
e8c0: 53 55 4c 54 3d 22 60 72 75 62 79 20 2d 65 20 5c  SULT="`ruby -e \
e8d0: 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 29 3b  "print(ARGV[0]);
e8e0: 5c 22 20 24 53 5f 54 4d 50 5f 30 60 22 0a 20 20  \" $S_TMP_0`".  
e8f0: 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
e900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
e910: 20 20 20 23 20 54 68 65 20 72 65 61 73 6f 6e 2c     # The reason,
e920: 20 77 68 79 20 65 76 65 72 79 74 68 69 6e 67 20   why everything 
e930: 69 73 20 64 6f 6e 65 20 77 69 74 68 20 72 75 62  is done with rub
e940: 79 20 61 74 20 74 68 65 20 6e 65 78 74 20 0a 20  y at the next . 
e950: 20 20 20 23 20 42 61 73 68 20 61 73 73 69 67 6e     # Bash assign
e960: 6d 65 6e 74 20 63 6c 61 75 73 65 20 69 73 20 74  ment clause is t
e970: 68 61 74 20 74 68 65 20 22 77 63 20 2d 6d 22 20  hat the "wc -m" 
e980: 70 61 64 73 20 69 74 73 20 6f 75 74 70 75 74 0a  pads its output.
e990: 20 20 20 20 23 20 77 69 74 68 20 73 70 61 63 65      # with space
e9a0: 73 20 6f 6e 20 42 53 44 2e 0a 20 20 20 20 53 5f  s on BSD..    S_
e9b0: 54 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20  TMP_0="`ruby -e 
e9c0: 5c 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d 2e  \"print(ARGV[0].
e9d0: 74 6f 5f 73 2e 6c 65 6e 67 74 68 2e 74 6f 5f 73  to_s.length.to_s
e9e0: 29 3b 5c 22 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d  );\" $S_FUNC_MMM
e9f0: 56 5f 54 49 47 45 52 48 41 53 48 5f 54 31 5f 52  V_TIGERHASH_T1_R
ea00: 45 53 55 4c 54 20 60 22 0a 20 20 20 20 23 2d 2d  ESULT `".    #--
ea10: 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50  ------.    S_TMP
ea20: 5f 31 3d 22 34 38 22 0a 20 20 20 20 69 66 20 5b  _1="48".    if [
ea30: 20 22 24 53 5f 54 4d 50 5f 30 22 20 21 3d 20 22   "$S_TMP_0" != "
ea40: 24 53 5f 54 4d 50 5f 31 22 20 5d 3b 20 74 68 65  $S_TMP_1" ]; the
ea50: 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  n.        echo "
ea60: 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
ea70: 41 63 63 6f 72 64 69 6e 67 20 74 6f 20 74 68 65  According to the
ea80: 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 20 6f   specification o
ea90: 66 20 74 68 65 20 54 69 67 65 72 20 68 61 73 68  f the Tiger hash
eaa0: 20 61 6c 67 6f 72 69 74 68 6d 22 0a 20 20 20 20   algorithm".    
eab0: 20 20 20 20 65 63 68 6f 20 22 74 68 65 20 6c 65      echo "the le
eac0: 6e 67 74 68 20 6f 66 20 74 68 65 20 54 69 67 65  ngth of the Tige
ead0: 72 20 68 61 73 68 20 69 73 20 22 0a 20 20 20 20  r hash is ".    
eae0: 20 20 20 20 65 63 68 6f 20 22 24 53 5f 54 4d 50      echo "$S_TMP
eaf0: 5f 31 20 68 65 78 61 64 65 63 69 6d 61 6c 20 63  _1 hexadecimal c
eb00: 68 61 72 61 63 74 65 72 73 2c 20 62 75 74 20 74  haracters, but t
eb10: 68 65 20 72 65 73 75 6c 74 20 6f 66 20 74 68 65  he result of the
eb20: 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
eb30: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
eb40: 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 74  "    func_mmmv_t
eb50: 69 67 65 72 68 61 73 68 5f 74 31 22 0a 20 20 20  igerhash_t1".   
eb60: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
eb70: 20 20 20 20 20 65 63 68 6f 20 22 69 73 20 73 6f       echo "is so
eb80: 6d 65 74 68 69 6e 67 20 65 6c 73 65 2e 20 54 68  mething else. Th
eb90: 65 20 66 6c 61 77 65 64 20 68 61 73 68 20 63 61  e flawed hash ca
eba0: 6e 64 69 64 61 74 65 20 69 6e 20 70 61 72 65 6e  ndidate in paren
ebb0: 74 68 65 73 69 73 3a 22 0a 20 20 20 20 20 20 20  thesis:".       
ebc0: 20 65 63 68 6f 20 22 28 24 53 5f 46 55 4e 43 5f   echo "($S_FUNC_
ebd0: 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54  MMMV_TIGERHASH_T
ebe0: 31 5f 52 45 53 55 4c 54 29 22 0a 20 20 20 20 20  1_RESULT)".     
ebf0: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
ec00: 20 20 20 65 63 68 6f 20 22 54 68 65 20 6c 65 6e     echo "The len
ec10: 67 74 68 20 63 61 6e 64 69 64 61 74 65 20 6f 66  gth candidate of
ec20: 20 74 68 65 20 66 6c 61 77 65 64 20 68 61 73 68   the flawed hash
ec30: 20 63 61 6e 64 69 64 61 74 65 20 69 6e 20 70 61   candidate in pa
ec40: 72 65 6e 74 68 65 73 69 73 3a 22 0a 20 20 20 20  renthesis:".    
ec50: 20 20 20 20 65 63 68 6f 20 22 28 24 53 5f 54 4d      echo "($S_TM
ec60: 50 5f 30 29 2e 22 0a 20 20 20 20 20 20 20 20 65  P_0).".        e
ec70: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
ec80: 63 68 6f 20 22 47 55 49 44 3d 3d 27 63 63 35 62  cho "GUID=='cc5b
ec90: 62 61 32 37 2d 64 30 63 62 2d 34 62 34 35 2d 38  ba27-d0cb-4b45-8
eca0: 34 31 66 2d 38 30 32 30 37 30 65 30 33 31 65 37  41f-802070e031e7
ecb0: 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
ecc0: 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
ecd0: 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
ece0: 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
ecf0: 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
ed00: 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20  h error.    fi. 
ed10: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
ed20: 2d 2d 2d 2d 2d 2d 2d 2d 0a 7d 20 23 20 66 75 6e  --------.} # fun
ed30: 63 5f 6d 6d 6d 76 5f 74 69 67 65 72 68 61 73 68  c_mmmv_tigerhash
ed40: 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d  _t1...#---------
ed50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
ed90: 2d 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57  -..S_FUNC_MMMV_W
eda0: 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f  HIRLPOOLHASH_T1_
edb0: 52 45 53 55 4c 54 3d 22 6e 6f 74 5f 79 65 74 5f  RESULT="not_yet_
edc0: 73 65 74 22 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56  set".S_FUNC_MMMV
edd0: 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54  _WHIRLPOOLHASH_T
ede0: 31 5f 4d 4f 44 45 3d 22 22 20 23 20 6f 70 74 69  1_MODE="" # opti
edf0: 6d 2e 20 74 6f 20 73 6b 69 70 20 72 65 70 65 61  m. to skip repea
ee00: 74 69 6e 67 20 63 6f 6e 73 6f 6c 65 20 74 6f 6f  ting console too
ee10: 6c 20 73 65 6c 65 63 74 69 6f 6e 0a 66 75 6e 63  l selection.func
ee20: 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70 6f 6f 6c 68  _mmmv_whirlpoolh
ee30: 61 73 68 5f 74 31 28 29 20 7b 20 23 20 72 65 71  ash_t1() { # req
ee40: 75 69 72 65 73 20 61 6c 73 6f 20 72 75 62 79 20  uires also ruby 
ee50: 61 6e 64 20 67 61 77 6b 20 0a 20 20 20 20 6c 6f  and gawk .    lo
ee60: 63 61 6c 20 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  cal S_FP_2_AN_EX
ee70: 49 53 54 49 4e 47 5f 46 49 4c 45 3d 22 24 31 22  ISTING_FILE="$1"
ee80: 20 23 20 66 69 72 73 74 20 66 75 6e 63 74 69 6f   # first functio
ee90: 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 23  n argument.    #
eea0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 75 6e  --------.    fun
eeb0: 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73 68 5f  c_mmmv_exc_hash_
eec0: 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74 5f 76  function_input_v
eed0: 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31 20 22  erification_t1 "
eee0: 66 75 6e 63 5f 6d 6d 6d 76 5f 77 68 69 72 6c 70  func_mmmv_whirlp
eef0: 6f 6f 6c 68 61 73 68 5f 74 31 22 20 22 24 31 22  oolhash_t1" "$1"
ef00: 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
ef10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23  ----------.    #
ef20: 20 4d 6f 64 65 20 73 65 6c 65 63 74 69 6f 6e 3a   Mode selection:
ef30: 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55  .    if [ "$S_FU
ef40: 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f  NC_MMMV_WHIRLPOO
ef50: 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 22 20 3d  LHASH_T1_MODE" =
ef60: 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20 20  = "" ] ; then.  
ef70: 20 20 20 20 20 20 53 42 5f 45 58 49 53 54 53 5f        SB_EXISTS_
ef80: 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c  ON_PATH_T1_RESUL
ef90: 54 3d 22 66 22 20 20 23 20 69 66 2d 62 6c 6f 63  T="f"  # if-bloc
efa0: 6b 20 69 6e 69 74 0a 20 20 20 20 20 20 20 20 23  k init.        #
efb0: 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20  ----.        if 
efc0: 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f 4e  [ "$SB_EXISTS_ON
efd0: 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54 22  _PATH_T1_RESULT"
efe0: 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68 65 6e   == "f" ] ; then
eff0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 5f 54  .            S_T
f000: 4d 50 5f 30 3d 22 77 68 69 72 6c 70 6f 6f 6c 64  MP_0="whirlpoold
f010: 65 65 70 22 20 23 20 75 73 75 61 6c 6c 79 20 61  eep" # usually a
f020: 76 61 69 6c 61 62 6c 65 20 6f 6e 20 4c 69 6e 75  vailable on Linu
f030: 78 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 75  x.            fu
f040: 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f  nc_sb_exists_on_
f050: 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d 50 5f  path_t1 "$S_TMP_
f060: 30 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  0" .            
f070: 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53  if [ "$SB_EXISTS
f080: 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55  _ON_PATH_T1_RESU
f090: 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20 74  LT" == "t" ] ; t
f0a0: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
f0b0: 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56       S_FUNC_MMMV
f0c0: 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54  _WHIRLPOOLHASH_T
f0d0: 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f 30  1_MODE="$S_TMP_0
f0e0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69  ".            fi
f0f0: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
f100: 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
f110: 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53    if [ "$SB_EXIS
f120: 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45  TS_ON_PATH_T1_RE
f130: 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d 20 3b  SULT" == "f" ] ;
f140: 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
f150: 20 20 53 5f 54 4d 50 5f 30 3d 22 72 68 61 73 68    S_TMP_0="rhash
f160: 22 20 20 20 20 23 20 70 61 72 74 20 6f 66 20 74  "    # part of t
f170: 68 65 20 42 53 44 20 70 61 63 6b 61 67 65 20 63  he BSD package c
f180: 6f 6c 6c 65 63 74 69 6f 6e 20 69 6e 20 32 30 31  ollection in 201
f190: 36 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 75  6.            fu
f1a0: 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f  nc_sb_exists_on_
f1b0: 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d 50 5f  path_t1 "$S_TMP_
f1c0: 30 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20  0" .            
f1d0: 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53  if [ "$SB_EXISTS
f1e0: 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55  _ON_PATH_T1_RESU
f1f0: 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20 74  LT" == "t" ] ; t
f200: 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
f210: 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56       S_FUNC_MMMV
f220: 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54  _WHIRLPOOLHASH_T
f230: 31 5f 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f 30  1_MODE="$S_TMP_0
f240: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69  ".            fi
f250: 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20  .        fi.    
f260: 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
f270: 20 20 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46        if [ "$S_F
f280: 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f  UNC_MMMV_WHIRLPO
f290: 4f 4c 48 41 53 48 5f 54 31 5f 4d 4f 44 45 22 20  OLHASH_T1_MODE" 
f2a0: 3d 3d 20 22 22 20 5d 20 3b 20 74 68 65 6e 0a 20  == "" ] ; then. 
f2b0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
f2c0: 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
f2d0: 63 68 6f 20 22 41 6c 6c 20 6f 66 20 74 68 65 20  cho "All of the 
f2e0: 57 68 69 72 6c 70 6f 6f 6c 20 68 61 73 68 20 69  Whirlpool hash i
f2f0: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 74  mplementations t
f300: 68 61 74 20 74 68 69 73 20 73 63 72 69 70 74 20  hat this script 
f310: 22 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  " .            e
f320: 63 68 6f 20 22 69 73 20 63 61 70 61 62 6c 65 20  cho "is capable 
f330: 6f 66 20 75 73 69 6e 67 20 28 77 68 69 72 6c 70  of using (whirlp
f340: 6f 6f 6c 64 65 65 70 2c 20 72 68 61 73 68 29 20  ooldeep, rhash) 
f350: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
f360: 68 6f 20 22 61 72 65 20 6d 69 73 73 69 6e 67 20  ho "are missing 
f370: 66 72 6f 6d 20 74 68 65 20 50 41 54 48 2e 22 0a  from the PATH.".
f380: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
f390: 20 22 47 55 49 44 3d 3d 27 31 30 35 37 61 65 34   "GUID=='1057ae4
f3a0: 32 2d 31 32 61 37 2d 34 61 34 33 2d 39 62 31 66  2-12a7-4a43-9b1f
f3b0: 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
f3c0: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
f3d0: 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
f3e0: 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
f3f0: 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
f400: 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
f410: 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
f420: 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
f430: 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d          #-------
f440: 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22  -.        if [ "
f450: 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68  $?" != "0" ]; th
f460: 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
f470: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
f480: 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 73 63     echo "This sc
f490: 72 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22  ript is flawed."
f4a0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
f4b0: 6f 20 22 47 55 49 44 3d 3d 27 32 35 34 63 62 66  o "GUID=='254cbf
f4c0: 38 35 2d 65 64 66 36 2d 34 37 30 66 2d 61 31 31  85-edf6-470f-a11
f4d0: 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22  f-802070e031e7'"
f4e0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
f4f0: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
f500: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
f510: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
f520: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69  .            exi
f530: 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
f540: 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69  error.        fi
f550: 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d  .        #------
f560: 2d 2d 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  --.    fi.    #-
f570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
f580: 2d 2d 2d 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d  ---.    S_FUNC_M
f590: 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41 53  MMV_WHIRLPOOLHAS
f5a0: 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22 0a 20  H_T1_RESULT="". 
f5b0: 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d     #------------
f5c0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20  --------.    if 
f5d0: 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  [ "$S_FUNC_MMMV_
f5e0: 57 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31  WHIRLPOOLHASH_T1
f5f0: 5f 4d 4f 44 45 22 20 3d 3d 20 22 77 68 69 72 6c  _MODE" == "whirl
f600: 70 6f 6f 6c 64 65 65 70 22 20 5d 3b 20 74 68 65  pooldeep" ]; the
f610: 6e 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  n.        S_TMP_
f620: 30 3d 22 60 77 68 69 72 6c 70 6f 6f 6c 64 65 65  0="`whirlpooldee
f630: 70 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49  p $S_FP_2_AN_EXI
f640: 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e 2f 64 65  STING_FILE 2>/de
f650: 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20 20  v/null`".       
f660: 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30   if [ "$?" != "0
f670: 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
f680: 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
f690: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
f6a0: 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70 6c  The console appl
f6b0: 69 63 61 74 69 6f 6e 20 5c 22 77 68 69 72 6c 70  ication \"whirlp
f6c0: 6f 6f 6c 64 65 65 70 5c 22 20 22 0a 20 20 20 20  ooldeep\" ".    
f6d0: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65 78          echo "ex
f6e0: 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72 72  ited with an err
f6f0: 6f 72 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  or.".           
f700: 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
f710: 20 20 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63       echo "----c
f720: 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d  onsole--output--
f730: 63 69 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d  citation--start-
f740: 2d 2d 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20  ----".          
f750: 20 20 65 63 68 6f 20 22 60 77 68 69 72 6c 70 6f    echo "`whirlpo
f760: 6f 6c 64 65 65 70 20 24 53 5f 46 50 5f 32 5f 41  oldeep $S_FP_2_A
f770: 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 60  N_EXISTING_FILE`
f780: 22 20 23 20 73 74 64 6f 75 74 20 61 6e 64 20 73  " # stdout and s
f790: 74 64 65 72 72 0a 20 20 20 20 20 20 20 20 20 20  tderr.          
f7a0: 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73    echo "----cons
f7b0: 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74  ole--output--cit
f7c0: 61 74 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d  ation--end------
f7d0: 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  -".            e
f7e0: 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
f7f0: 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
f800: 32 35 62 34 62 64 31 33 2d 62 30 62 36 2d 34 64  25b4bd13-b0b6-4d
f810: 30 64 2d 39 34 31 66 2d 38 30 32 30 37 30 65 30  0d-941f-802070e0
f820: 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20  31e7'".         
f830: 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
f840: 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
f850: 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46           cd $S_F
f860: 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20  P_ORIG.         
f870: 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
f880: 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
f890: 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 53      fi.        S
f8a0: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c  _FUNC_MMMV_WHIRL
f8b0: 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52 45 53 55  POOLHASH_T1_RESU
f8c0: 4c 54 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70  LT="`ruby -e \"p
f8d0: 72 69 6e 74 28 41 52 47 56 5b 30 5d 29 3b 5c 22  rint(ARGV[0]);\"
f8e0: 20 24 53 5f 54 4d 50 5f 30 20 60 22 0a 20 20 20   $S_TMP_0 `".   
f8f0: 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d   fi.    #-------
f900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
f910: 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f    if [ "$S_FUNC_
f920: 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41  MMMV_WHIRLPOOLHA
f930: 53 48 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22  SH_T1_MODE" == "
f940: 72 68 61 73 68 22 20 5d 3b 20 74 68 65 6e 0a 20  rhash" ]; then. 
f950: 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22         S_TMP_0="
f960: 60 72 68 61 73 68 20 2d 2d 77 68 69 72 6c 70 6f  `rhash --whirlpo
f970: 6f 6c 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58  ol $S_FP_2_AN_EX
f980: 49 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e 2f 64  ISTING_FILE 2>/d
f990: 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20 20 20  ev/null`".      
f9a0: 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22    if [ "$?" != "
f9b0: 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
f9c0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
f9d0: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
f9e0: 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61 70 70  "The console app
f9f0: 6c 69 63 61 74 69 6f 6e 20 5c 22 72 68 61 73 68  lication \"rhash
fa00: 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  \" ".           
fa10: 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69   echo "exited wi
fa20: 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20  th an error.".  
fa30: 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
fa40: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
fa50: 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d  ho "----console-
fa60: 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f  -output--citatio
fa70: 6e 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a 20  n--start-----". 
fa80: 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
fa90: 22 60 72 68 61 73 68 20 2d 2d 77 68 69 72 6c 70  "`rhash --whirlp
faa0: 6f 6f 6c 20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45  ool $S_FP_2_AN_E
fab0: 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 60 22 0a  XISTING_FILE `".
fac0: 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
fad0: 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f   "----console--o
fae0: 75 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d  utput--citation-
faf0: 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20  -end-------".   
fb00: 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
fb10: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
fb20: 6f 20 22 47 55 49 44 3d 3d 27 32 65 61 66 34 35  o "GUID=='2eaf45
fb30: 34 32 2d 64 37 30 30 2d 34 31 33 37 2d 39 33 31  42-d700-4137-931
fb40: 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22  f-802070e031e7'"
fb50: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
fb60: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
fb70: 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
fb80: 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
fb90: 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69  .            exi
fba0: 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
fbb0: 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69  error.        fi
fbc0: 0a 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f  .        S_FUNC_
fbd0: 4d 4d 4d 56 5f 57 48 49 52 4c 50 4f 4f 4c 48 41  MMMV_WHIRLPOOLHA
fbe0: 53 48 5f 54 31 5f 52 45 53 55 4c 54 3d 22 60 72  SH_T1_RESULT="`r
fbf0: 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 28 41  uby -e \"print(A
fc00: 52 47 56 5b 30 5d 29 3b 5c 22 20 24 53 5f 54 4d  RGV[0]);\" $S_TM
fc10: 50 5f 30 20 60 22 0a 20 20 20 20 66 69 0a 20 20  P_0 `".    fi.  
fc20: 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
fc30: 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54 68  -------.    # Th
fc40: 65 20 72 65 61 73 6f 6e 2c 20 77 68 79 20 65 76  e reason, why ev
fc50: 65 72 79 74 68 69 6e 67 20 69 73 20 64 6f 6e 65  erything is done
fc60: 20 77 69 74 68 20 72 75 62 79 20 61 74 20 74 68   with ruby at th
fc70: 65 20 6e 65 78 74 20 0a 20 20 20 20 23 20 42 61  e next .    # Ba
fc80: 73 68 20 61 73 73 69 67 6e 6d 65 6e 74 20 63 6c  sh assignment cl
fc90: 61 75 73 65 20 69 73 20 74 68 61 74 20 74 68 65  ause is that the
fca0: 20 22 77 63 20 2d 6d 22 20 70 61 64 73 20 69 74   "wc -m" pads it
fcb0: 73 20 6f 75 74 70 75 74 0a 20 20 20 20 23 20 77  s output.    # w
fcc0: 69 74 68 20 73 70 61 63 65 73 20 6f 6e 20 42 53  ith spaces on BS
fcd0: 44 2e 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22  D..    S_TMP_0="
fce0: 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74  `ruby -e \"print
fcf0: 28 41 52 47 56 5b 30 5d 2e 74 6f 5f 73 2e 6c 65  (ARGV[0].to_s.le
fd00: 6e 67 74 68 2e 74 6f 5f 73 29 3b 5c 22 20 24 53  ngth.to_s);\" $S
fd10: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c  _FUNC_MMMV_WHIRL
fd20: 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52 45 53 55  POOLHASH_T1_RESU
fd30: 4c 54 20 60 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d  LT `".    #-----
fd40: 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f 31 3d  ---.    S_TMP_1=
fd50: 22 31 32 38 22 0a 20 20 20 20 69 66 20 5b 20 22  "128".    if [ "
fd60: 24 53 5f 54 4d 50 5f 30 22 20 21 3d 20 22 24 53  $S_TMP_0" != "$S
fd70: 5f 54 4d 50 5f 31 22 20 5d 3b 20 74 68 65 6e 0a  _TMP_1" ]; then.
fd80: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
fd90: 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 41 63          echo "Ac
fda0: 63 6f 72 64 69 6e 67 20 74 6f 20 74 68 65 20 73  cording to the s
fdb0: 70 65 63 69 66 69 63 61 74 69 6f 6e 20 6f 66 20  pecification of 
fdc0: 74 68 65 20 57 68 69 72 6c 70 6f 6f 6c 20 68 61  the Whirlpool ha
fdd0: 73 68 20 61 6c 67 6f 72 69 74 68 6d 22 0a 20 20  sh algorithm".  
fde0: 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 65 20        echo "the 
fdf0: 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20 54 69  length of the Ti
fe00: 67 65 72 20 68 61 73 68 20 69 73 20 22 0a 20 20  ger hash is ".  
fe10: 20 20 20 20 20 20 65 63 68 6f 20 22 24 53 5f 54        echo "$S_T
fe20: 4d 50 5f 31 20 68 65 78 61 64 65 63 69 6d 61 6c  MP_1 hexadecimal
fe30: 20 63 68 61 72 61 63 74 65 72 73 2c 20 62 75 74   characters, but
fe40: 20 74 68 65 20 72 65 73 75 6c 74 20 6f 66 20 74   the result of t
fe50: 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
fe60: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
fe70: 6f 20 22 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  o "    func_mmmv
fe80: 5f 77 68 69 72 6c 70 6f 6f 6c 68 61 73 68 5f 74  _whirlpoolhash_t
fe90: 31 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  1".        echo 
fea0: 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
feb0: 22 69 73 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c  "is something el
fec0: 73 65 2e 20 54 68 65 20 66 6c 61 77 65 64 20 68  se. The flawed h
fed0: 61 73 68 20 63 61 6e 64 69 64 61 74 65 20 69 6e  ash candidate in
fee0: 20 70 61 72 65 6e 74 68 65 73 69 73 3a 22 0a 20   parenthesis:". 
fef0: 20 20 20 20 20 20 20 65 63 68 6f 20 22 28 24 53         echo "($S
ff00: 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48 49 52 4c  _FUNC_MMMV_WHIRL
ff10: 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52 45 53 55  POOLHASH_T1_RESU
ff20: 4c 54 29 22 0a 20 20 20 20 20 20 20 20 65 63 68  LT)".        ech
ff30: 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
ff40: 6f 20 22 54 68 65 20 6c 65 6e 67 74 68 20 63 61  o "The length ca
ff50: 6e 64 69 64 61 74 65 20 6f 66 20 74 68 65 20 66  ndidate of the f
ff60: 6c 61 77 65 64 20 68 61 73 68 20 63 61 6e 64 69  lawed hash candi
ff70: 64 61 74 65 20 69 6e 20 70 61 72 65 6e 74 68 65  date in parenthe
ff80: 73 69 73 3a 22 0a 20 20 20 20 20 20 20 20 65 63  sis:".        ec
ff90: 68 6f 20 22 28 24 53 5f 54 4d 50 5f 30 29 2e 22  ho "($S_TMP_0)."
ffa0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
ffb0: 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
ffc0: 55 49 44 3d 3d 27 61 33 34 61 66 63 35 39 2d 65  UID=='a34afc59-e
ffd0: 63 65 65 2d 34 64 34 64 2d 38 35 30 66 2d 38 30  cee-4d4d-850f-80
ffe0: 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  2070e031e7'".   
fff0: 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
10000 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
10010 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
10020 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
10030 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
10040 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  r.    fi.    #--
10050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
10060 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  --.} # func_mmmv
10070 5f 77 68 69 72 6c 70 6f 6f 6c 68 61 73 68 5f 74  _whirlpoolhash_t
10080 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  1...#-----------
10090 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
100a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
100b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
100c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
100d0 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c  .S_FUNC_MMMV_FIL
100e0 45 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 3d  ESIZE_T1_RESULT=
100f0 22 6e 6f 74 5f 79 65 74 5f 73 65 74 22 0a 53 5f  "not_yet_set".S_
10100 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49  FUNC_MMMV_FILESI
10110 5a 45 5f 54 31 5f 4d 4f 44 45 3d 22 22 20 23 20  ZE_T1_MODE="" # 
10120 6f 70 74 69 6d 2e 20 74 6f 20 73 6b 69 70 20 72  optim. to skip r
10130 65 70 65 61 74 69 6e 67 20 63 6f 6e 73 6f 6c 65  epeating console
10140 20 74 6f 6f 6c 20 73 65 6c 65 63 74 69 6f 6e 0a   tool selection.
10150 66 75 6e 63 5f 6d 6d 6d 76 5f 66 69 6c 65 73 69  func_mmmv_filesi
10160 7a 65 5f 74 31 28 29 20 7b 20 0a 20 20 20 20 6c  ze_t1() { .    l
10170 6f 63 61 6c 20 53 5f 46 50 5f 32 5f 41 4e 5f 45  ocal S_FP_2_AN_E
10180 58 49 53 54 49 4e 47 5f 46 49 4c 45 3d 22 24 31  XISTING_FILE="$1
10190 22 20 23 20 66 69 72 73 74 20 66 75 6e 63 74 69  " # first functi
101a0 6f 6e 20 61 72 67 75 6d 65 6e 74 0a 20 20 20 20  on argument.    
101b0 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 75  #--------.    fu
101c0 6e 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73 68  nc_mmmv_exc_hash
101d0 5f 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74 5f  _function_input_
101e0 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31 20  verification_t1 
101f0 22 66 75 6e 63 5f 6d 6d 6d 76 5f 66 69 6c 65 73  "func_mmmv_files
10200 69 7a 65 5f 74 31 22 20 22 24 31 22 0a 20 20 20  ize_t1" "$1".   
10210 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   #--------------
10220 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 4d 6f 64  ------.    # Mod
10230 65 20 73 65 6c 65 63 74 69 6f 6e 3a 0a 20 20 20  e selection:.   
10240 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d   if [ "$S_FUNC_M
10250 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f  MMV_FILESIZE_T1_
10260 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20  MODE" == "" ] ; 
10270 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f  then.        SB_
10280 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
10290 31 5f 52 45 53 55 4c 54 3d 22 66 22 20 20 23 20  1_RESULT="f"  # 
102a0 69 66 2d 62 6c 6f 63 6b 20 69 6e 69 74 0a 20 20  if-block init.  
102b0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
102c0 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
102d0 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
102e0 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d  RESULT" == "f" ]
102f0 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
10300 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 66 69 6c      S_TMP_0="fil
10310 65 73 69 7a 65 22 20 23 20 75 73 75 61 6c 6c 79  esize" # usually
10320 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 4c 69   available on Li
10330 6e 75 78 0a 20 20 20 20 20 20 20 20 20 20 20 20  nux.            
10340 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f 6f  func_sb_exists_o
10350 6e 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54 4d  n_path_t1 "$S_TM
10360 50 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20 20  P_0" .          
10370 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49 53    if [ "$SB_EXIS
10380 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45  TS_ON_PATH_T1_RE
10390 53 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20 3b  SULT" == "t" ] ;
103a0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
103b0 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d         S_FUNC_MM
103c0 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 4d  MV_FILESIZE_T1_M
103d0 4f 44 45 3d 22 24 53 5f 54 4d 50 5f 30 22 0a 20  ODE="$S_TMP_0". 
103e0 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20 20             fi.  
103f0 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
10400 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69   #----.        i
10410 66 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f  f [ "$SB_EXISTS_
10420 4f 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c  ON_PATH_T1_RESUL
10430 54 22 20 3d 3d 20 22 66 22 20 5d 20 3b 20 74 68  T" == "f" ] ; th
10440 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53  en.            S
10450 5f 54 4d 50 5f 30 3d 22 72 75 62 79 22 20 20 20  _TMP_0="ruby"   
10460 20 23 20 68 65 6c 70 73 20 6f 6e 20 42 53 44 0a   # helps on BSD.
10470 20 20 20 20 20 20 20 20 20 20 20 20 66 75 6e 63              func
10480 5f 73 62 5f 65 78 69 73 74 73 5f 6f 6e 5f 70 61  _sb_exists_on_pa
10490 74 68 5f 74 31 20 22 24 53 5f 54 4d 50 5f 30 22  th_t1 "$S_TMP_0"
104a0 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66   .            if
104b0 20 5b 20 22 24 53 42 5f 45 58 49 53 54 53 5f 4f   [ "$SB_EXISTS_O
104c0 4e 5f 50 41 54 48 5f 54 31 5f 52 45 53 55 4c 54  N_PATH_T1_RESULT
104d0 22 20 3d 3d 20 22 74 22 20 5d 20 3b 20 74 68 65  " == "t" ] ; the
104e0 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  n.              
104f0 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46     S_FUNC_MMMV_F
10500 49 4c 45 53 49 5a 45 5f 54 31 5f 4d 4f 44 45 3d  ILESIZE_T1_MODE=
10510 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20  "$S_TMP_0".     
10520 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
10530 20 20 66 69 0a 20 20 20 20 20 20 20 20 23 2d 2d    fi.        #--
10540 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 69  ------.        i
10550 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d  f [ "$S_FUNC_MMM
10560 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 4d 4f  V_FILESIZE_T1_MO
10570 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20 74 68  DE" == "" ] ; th
10580 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
10590 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
105a0 20 20 20 65 63 68 6f 20 22 41 6c 6c 20 6f 66 20     echo "All of 
105b0 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73  the applications
105c0 20 74 68 61 74 20 74 68 69 73 20 66 75 6e 63 74   that this funct
105d0 69 6f 6e 20 69 73 20 22 20 0a 20 20 20 20 20 20  ion is " .      
105e0 20 20 20 20 20 20 65 63 68 6f 20 22 63 61 70 61        echo "capa
105f0 62 6c 65 20 6f 66 20 75 73 69 6e 67 20 66 6f 72  ble of using for
10600 20 66 69 6e 64 69 6e 67 20 6f 75 74 20 66 69 6c   finding out fil
10610 65 20 73 69 7a 65 20 28 66 69 6c 65 73 69 7a 65  e size (filesize
10620 2c 20 72 75 62 79 29 22 0a 20 20 20 20 20 20 20  , ruby)".       
10630 20 20 20 20 20 65 63 68 6f 20 22 61 72 65 20 6d       echo "are m
10640 69 73 73 69 6e 67 20 66 72 6f 6d 20 74 68 65 20  issing from the 
10650 50 41 54 48 2e 22 0a 20 20 20 20 20 20 20 20 20  PATH.".         
10660 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
10670 32 34 30 36 66 38 66 32 2d 62 34 64 34 2d 34 61  2406f8f2-b4d4-4a
10680 38 37 2d 38 31 30 66 2d 38 30 32 30 37 30 65 30  87-810f-802070e0
10690 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 20  31e7'".         
106a0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
106b0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
106c0 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46           cd $S_F
106d0 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20  P_ORIG.         
106e0 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
106f0 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
10700 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20 23      fi.        #
10710 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20  --------.       
10720 20 69 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30   if [ "$?" != "0
10730 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
10740 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
10750 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
10760 54 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66  This script is f
10770 6c 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20  lawed.".        
10780 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
10790 27 66 38 31 32 38 66 36 35 2d 39 66 62 64 2d 34  'f8128f65-9fbd-4
107a0 64 32 63 2d 62 33 30 66 2d 38 30 32 30 37 30 65  d2c-b30f-802070e
107b0 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
107c0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
107d0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
107e0 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
107f0 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
10800 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
10810 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
10820 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
10830 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 66 69  #--------.    fi
10840 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
10850 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53  ----------.    S
10860 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53  _FUNC_MMMV_FILES
10870 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 22  IZE_T1_RESULT=""
10880 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .    #----------
10890 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69  ----------.    i
108a0 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d  f [ "$S_FUNC_MMM
108b0 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 4d 4f  V_FILESIZE_T1_MO
108c0 44 45 22 20 3d 3d 20 22 66 69 6c 65 73 69 7a 65  DE" == "filesize
108d0 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
108e0 20 20 53 5f 54 4d 50 5f 30 3d 22 60 66 69 6c 65    S_TMP_0="`file
108f0 73 69 7a 65 20 24 53 5f 46 50 5f 32 5f 41 4e 5f  size $S_FP_2_AN_
10900 45 58 49 53 54 49 4e 47 5f 46 49 4c 45 20 32 3e  EXISTING_FILE 2>
10910 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20  /dev/null`".    
10920 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d      if [ "$?" !=
10930 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "0" ]; then.   
10940 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
10950 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
10960 6f 20 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61  o "The console a
10970 70 70 6c 69 63 61 74 69 6f 6e 20 5c 22 66 69 6c  pplication \"fil
10980 65 73 69 7a 65 5c 22 20 22 0a 20 20 20 20 20 20  esize\" ".      
10990 20 20 20 20 20 20 65 63 68 6f 20 22 65 78 69 74        echo "exit
109a0 65 64 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72  ed with an error
109b0 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  .".            e
109c0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
109d0 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e     echo "----con
109e0 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69  sole--output--ci
109f0 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d  tation--start---
10a00 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  --".            
10a10 65 63 68 6f 20 22 60 66 69 6c 65 73 69 7a 65 20  echo "`filesize 
10a20 24 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54  $S_FP_2_AN_EXIST
10a30 49 4e 47 5f 46 49 4c 45 60 22 20 23 20 73 74 64  ING_FILE`" # std
10a40 6f 75 74 20 61 6e 64 20 73 74 64 65 72 72 0a 20  out and stderr. 
10a50 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10a60 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75  "----console--ou
10a70 74 70 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d  tput--citation--
10a80 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20  end-------".    
10a90 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
10aa0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
10ab0 20 22 47 55 49 44 3d 3d 27 33 35 64 61 36 34 63   "GUID=='35da64c
10ac0 65 2d 36 64 61 39 2d 34 31 34 33 2d 39 32 30 66  e-6da9-4143-920f
10ad0 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
10ae0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
10af0 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
10b00 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
10b10 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
10b20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
10b30 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
10b40 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
10b50 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d          S_FUNC_M
10b60 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f  MMV_FILESIZE_T1_
10b70 52 45 53 55 4c 54 3d 22 60 72 75 62 79 20 2d 65  RESULT="`ruby -e
10b80 20 5c 22 70 72 69 6e 74 28 41 52 47 56 5b 30 5d   \"print(ARGV[0]
10b90 29 3b 5c 22 20 24 53 5f 54 4d 50 5f 30 20 60 22  );\" $S_TMP_0 `"
10ba0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
10bb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
10bc0 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46  -.    if [ "$S_F
10bd0 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a  UNC_MMMV_FILESIZ
10be0 45 5f 54 31 5f 4d 4f 44 45 22 20 3d 3d 20 22 72  E_T1_MODE" == "r
10bf0 75 62 79 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  uby" ]; then.   
10c00 20 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 60 72       S_TMP_0="`r
10c10 75 62 79 20 2d 65 20 5c 22 70 72 69 6e 74 66 28  uby -e \"printf(
10c20 46 69 6c 65 2e 73 69 7a 65 28 27 24 53 5f 46 50  File.size('$S_FP
10c30 5f 32 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46  _2_AN_EXISTING_F
10c40 49 4c 45 27 29 2e 74 6f 5f 73 29 5c 22 20 32 3e  ILE').to_s)\" 2>
10c50 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a 20 20 20 20  /dev/null`".    
10c60 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21 3d      if [ "$?" !=
10c70 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "0" ]; then.   
10c80 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
10c90 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
10ca0 6f 20 22 54 68 65 20 63 6f 6e 73 6f 6c 65 20 61  o "The console a
10cb0 70 70 6c 69 63 61 74 69 6f 6e 20 5c 22 72 75 62  pplication \"rub
10cc0 79 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20  y\" ".          
10cd0 20 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77    echo "exited w
10ce0 69 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20  ith an error.". 
10cf0 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
10d00 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
10d10 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c 65  cho "----console
10d20 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74 69  --output--citati
10d30 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d 2d 2d 22 0a  on--start-----".
10d40 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
10d50 20 22 60 72 75 62 79 20 2d 65 20 5c 22 70 72 69   "`ruby -e \"pri
10d60 6e 74 66 28 46 69 6c 65 2e 73 69 7a 65 28 27 24  ntf(File.size('$
10d70 53 5f 46 50 5f 32 5f 41 4e 5f 45 58 49 53 54 49  S_FP_2_AN_EXISTI
10d80 4e 47 5f 46 49 4c 45 27 29 2e 74 6f 5f 73 29 5c  NG_FILE').to_s)\
10d90 22 60 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  "`".            
10da0 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e 73 6f 6c  echo "----consol
10db0 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69 74 61 74  e--output--citat
10dc0 69 6f 6e 2d 2d 65 6e 64 2d 2d 2d 2d 2d 2d 2d 22  ion--end-------"
10dd0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
10de0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
10df0 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 36 65   echo "GUID=='6e
10e00 66 63 64 35 34 33 2d 30 61 65 35 2d 34 33 36 39  fcd543-0ae5-4369
10e10 2d 39 35 30 66 2d 38 30 32 30 37 30 65 30 33 31  -950f-802070e031
10e20 65 37 27 22 0a 20 20 20 20 20 20 20 20 20 20 20  e7'".           
10e30 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
10e40 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
10e50 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
10e60 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20  ORIG.           
10e70 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
10e80 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 20 20  ith error.      
10e90 20 20 66 69 0a 20 20 20 20 20 20 20 20 53 5f 46    fi.        S_F
10ea0 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a  UNC_MMMV_FILESIZ
10eb0 45 5f 54 31 5f 52 45 53 55 4c 54 3d 22 24 53 5f  E_T1_RESULT="$S_
10ec0 54 4d 50 5f 30 22 0a 20 20 20 20 66 69 0a 20 20  TMP_0".    fi.  
10ed0 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d    #-------------
10ee0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d  -------.    S_TM
10ef0 50 5f 30 3d 22 60 72 75 62 79 20 2d 65 20 5c 22  P_0="`ruby -e \"
10f00 70 72 69 6e 74 28 28 27 27 2b 41 52 47 56 5b 30  print((''+ARGV[0
10f10 5d 29 2e 67 73 75 62 28 2f 5b 5c 73 5d 2b 2f 2c  ]).gsub(/[\s]+/,
10f20 27 27 29 29 3b 5c 22 20 24 53 5f 46 55 4e 43 5f  ''));\" $S_FUNC_
10f30 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31  MMMV_FILESIZE_T1
10f40 5f 52 45 53 55 4c 54 20 60 22 0a 20 20 20 20 6c  _RESULT `".    l
10f50 6f 63 61 6c 20 53 42 5f 54 48 52 4f 57 3d 22 66  ocal SB_THROW="f
10f60 22 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 54  ".    if [ "$S_T
10f70 4d 50 5f 30 22 20 21 3d 20 22 24 53 5f 46 55 4e  MP_0" != "$S_FUN
10f80 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a 45 5f  C_MMMV_FILESIZE_
10f90 54 31 5f 52 45 53 55 4c 54 22 20 5d 3b 20 74 68  T1_RESULT" ]; th
10fa0 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 54 48  en.        SB_TH
10fb0 52 4f 57 3d 22 74 22 0a 20 20 20 20 65 6c 73 65  ROW="t".    else
10fc0 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24  .        if [ "$
10fd0 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45  S_FUNC_MMMV_FILE
10fe0 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 22 20  SIZE_T1_RESULT" 
10ff0 3d 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20  == "" ]; then.  
11000 20 20 20 20 20 20 20 20 20 20 53 42 5f 54 48 52            SB_THR
11010 4f 57 3d 22 74 22 0a 20 20 20 20 20 20 20 20 66  OW="t".        f
11020 69 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  i.    fi.    #--
11030 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 42  --.    if [ "$SB
11040 5f 54 48 52 4f 57 22 20 3d 3d 20 22 74 22 20 5d  _THROW" == "t" ]
11050 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
11060 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
11070 63 68 6f 20 22 54 68 65 20 72 65 73 75 6c 74 20  cho "The result 
11080 6f 66 20 74 68 65 20 22 0a 20 20 20 20 20 20 20  of the ".       
11090 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
110a0 20 65 63 68 6f 20 22 20 20 20 20 66 75 6e 63 5f   echo "    func_
110b0 6d 6d 6d 76 5f 66 69 6c 65 73 69 7a 65 5f 74 31  mmmv_filesize_t1
110c0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
110d0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
110e0 66 6f 72 20 22 0a 20 20 20 20 20 20 20 20 65 63  for ".        ec
110f0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
11100 68 6f 20 22 28 24 53 5f 46 55 4e 43 5f 4d 4d 4d  ho "($S_FUNC_MMM
11110 56 5f 46 49 4c 45 53 49 5a 45 5f 54 31 5f 52 45  V_FILESIZE_T1_RE
11120 53 55 4c 54 29 22 0a 20 20 20 20 20 20 20 20 65  SULT)".        e
11130 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
11140 63 68 6f 20 22 65 69 74 68 65 72 20 63 6f 6e 74  cho "either cont
11150 61 69 6e 20 73 70 61 63 65 73 2c 20 74 61 62 73  ain spaces, tabs
11160 20 6f 72 20 69 73 20 61 6e 20 65 6d 70 74 79 20   or is an empty 
11170 73 74 72 69 6e 67 2c 22 20 0a 20 20 20 20 20 20  string," .      
11180 20 20 65 63 68 6f 20 22 77 68 69 63 68 20 69 73    echo "which is
11190 20 77 72 6f 6e 67 2c 20 62 65 63 61 75 73 65 20   wrong, because 
111a0 65 76 65 6e 20 61 20 66 69 6c 65 20 77 69 74 68  even a file with
111b0 20 74 68 65 20 73 69 7a 65 20 6f 66 20 30 20 22   the size of 0 "
111c0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 73  .        echo "s
111d0 68 6f 75 6c 64 20 68 61 76 65 20 61 20 66 69 6c  hould have a fil
111e0 65 20 73 69 7a 65 20 6f 66 20 5c 22 30 5c 22 2c  e size of \"0\",
111f0 20 77 68 69 63 68 20 69 73 20 6e 6f 74 20 61 6e   which is not an
11200 20 65 6d 70 74 79 20 73 74 72 69 6e 67 2e 22 0a   empty string.".
11210 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
11220 49 44 3d 3d 27 31 34 61 62 33 30 35 33 2d 62 30  ID=='14ab3053-b0
11230 66 31 2d 34 63 35 63 2d 39 33 30 66 2d 38 30 32  f1-4c5c-930f-802
11240 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
11250 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
11260 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
11270 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
11280 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
11290 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
112a0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
112b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
112c0 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f  -.} # func_mmmv_
112d0 66 69 6c 65 73 69 7a 65 5f 74 31 0a 0a 0a 23 2d  filesize_t1...#-
112e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
112f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11300 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11310 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11320 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63 5f  ---------..func_
11330 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
11340 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
11350 68 5f 70 72 69 6e 74 5f 68 65 6c 70 5f 6d 73 67  h_print_help_msg
11360 5f 74 31 28 29 20 7b 20 0a 20 20 20 20 65 63 68  _t1() { .    ech
11370 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20 22 43  o "".    echo "C
11380 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 66 6f 72 6d  ommand line form
11390 61 74 3a 20 22 0a 20 20 20 20 65 63 68 6f 20 22  at: ".    echo "
113a0 22 0a 20 20 20 20 65 63 68 6f 20 22 3c 74 68 65  ".    echo "<the
113b0 20 6e 61 6d 65 20 6f 66 20 74 68 69 73 20 73 63   name of this sc
113c0 72 69 70 74 3e 20 20 41 52 47 4c 49 53 54 20 22  ript>  ARGLIST "
113d0 0a 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20  .    echo "".   
113e0 20 65 63 68 6f 20 22 20 20 41 52 47 4c 49 53 54   echo "  ARGLIST
113f0 20 3a 3d 3d 20 68 65 6c 70 20 7c 20 57 52 41 50   :== help | WRAP
11400 20 7c 20 55 4e 57 52 41 50 20 7c 20 52 55 4e 5f   | UNWRAP | RUN_
11410 53 45 4c 46 54 45 53 54 20 7c 20 56 45 52 49 46  SELFTEST | VERIF
11420 59 20 7c 22 0a 20 20 20 20 65 63 68 6f 20 22 20  Y |".    echo " 
11430 20 20 20 20 20 20 20 20 20 20 20 20 20 56 45 52               VER
11440 49 46 59 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f  IFY_PACKET_NAME_
11450 46 4f 52 4d 41 54 5f 56 31 20 7c 20 76 65 72 73  FORMAT_V1 | vers
11460 69 6f 6e 20 7c 20 76 65 72 73 69 6f 6e 5f 74 69  ion | version_ti
11470 6d 65 73 74 61 6d 70 20 22 0a 20 20 20 20 65 63  mestamp ".    ec
11480 68 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20 22  ho "".    echo "
11490 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
114a0 20 20 20 57 52 41 50 20 3a 3d 3d 20 77 72 61 70     WRAP :== wrap
114b0 20 20 20 20 20 20 20 20 20 3c 66 69 6c 65 20 70           <file p
114c0 61 74 68 3e 20 28 4e 5f 4f 46 5f 52 41 4e 44 4f  ath> (N_OF_RANDO
114d0 4d 5f 54 45 58 54 5f 42 4c 4f 43 4b 53 29 3f 22  M_TEXT_BLOCKS)?"
114e0 0a 20 20 20 20 65 63 68 6f 20 22 4e 5f 4f 46 5f  .    echo "N_OF_
114f0 52 41 4e 44 4f 4d 5f 54 45 58 54 5f 42 4c 4f 43  RANDOM_TEXT_BLOC
11500 4b 53 20 3a 3d 3d 20 20 20 20 20 20 20 20 20 20  KS :==          
11510 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11520 20 3c 70 6f 73 69 74 69 76 65 20 77 68 6f 6c 65   <positive whole
11530 20 6e 75 6d 62 65 72 3e 20 22 0a 20 20 20 20 65   number> ".    e
11540 63 68 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20  cho "".    echo 
11550 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  "               
11560 20 20 55 4e 57 52 41 50 20 3a 3d 3d 20 75 6e 77    UNWRAP :== unw
11570 72 61 70 20 20 20 20 20 20 20 3c 66 69 6c 65 20  rap       <file 
11580 70 61 74 68 3e 20 22 0a 20 20 20 20 65 63 68 6f  path> ".    echo
11590 20 22 20 20 20 20 20 20 20 20 20 20 20 52 55 4e   "           RUN
115a0 5f 53 45 4c 46 54 45 53 54 20 3a 3d 3d 20 74 65  _SELFTEST :== te
115b0 73 74 5f 68 61 73 68 5f 74 31 20 3c 66 69 6c 65  st_hash_t1 <file
115c0 20 70 61 74 68 3e 20 22 0a 20 20 20 20 65 63 68   path> ".    ech
115d0 6f 20 22 20 20 20 20 20 20 20 20 20 20 20 20 20  o "             
115e0 20 20 20 20 56 45 52 49 46 59 20 3a 3d 3d 20 76      VERIFY :== v
115f0 65 72 69 66 79 20 20 20 20 20 20 20 3c 66 69 6c  erify       <fil
11600 65 20 70 61 74 68 3e 20 22 0a 20 20 20 20 65 63  e path> ".    ec
11610 68 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20 22  ho "".    echo "
11620 20 20 56 45 52 49 46 59 5f 50 41 43 4b 45 54 5f    VERIFY_PACKET_
11630 4e 41 4d 45 5f 46 4f 52 4d 41 54 5f 56 31 20 3a  NAME_FORMAT_V1 :
11640 3d 3d 20 76 65 72 69 66 79 5f 70 61 63 6b 65 74  == verify_packet
11650 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f 76 31 20  _name_format_v1 
11660 58 3c 70 61 63 6b 65 74 20 6e 61 6d 65 20 22 0a  X<packet name ".
11670 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 20 20      echo "      
11680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
11690 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
116a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
116b0 20 20 20 20 20 20 20 20 20 20 20 63 61 6e 64 69             candi
116c0 64 61 74 65 20 73 74 72 69 6e 67 3e 58 22 0a 20  date string>X". 
116d0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 65     echo "".    e
116e0 63 68 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20  cho "".    echo 
116f0 22 49 66 20 74 68 69 73 20 41 50 49 20 69 73 20  "If this API is 
11700 75 73 65 64 20 63 6f 72 72 65 63 74 6c 79 20 61  used correctly a
11710 6e 64 20 74 68 65 72 65 20 61 72 65 20 6e 6f 20  nd there are no 
11720 6f 74 68 65 72 20 22 0a 20 20 20 20 65 63 68 6f  other ".    echo
11730 20 22 72 65 61 73 6f 6e 73 20 66 6f 72 20 74 68   "reasons for th
11740 65 20 66 61 69 6c 75 72 65 20 6f 66 20 74 68 69  e failure of thi
11750 73 20 73 63 72 69 70 74 2c 20 74 68 65 6e 20 22  s script, then "
11760 0a 20 20 20 20 65 63 68 6f 20 22 61 6c 6c 20 6f  .    echo "all o
11770 66 20 74 68 65 20 76 65 72 69 66 69 63 61 74 69  f the verificati
11780 6f 6e 20 63 6f 6d 6d 61 6e 64 73 20 65 78 69 74  on commands exit
11790 20 77 69 74 68 20 65 72 72 6f 72 20 63 6f 64 65   with error code
117a0 20 30 20 22 0a 20 20 20 20 65 63 68 6f 20 22 72   0 ".    echo "r
117b0 65 67 61 72 64 6c 65 73 73 20 6f 66 20 77 68 65  egardless of whe
117c0 74 68 65 72 20 74 68 65 20 76 65 72 69 66 69 63  ther the verific
117d0 61 74 69 6f 6e 20 66 61 69 6c 73 20 6f 72 20 70  ation fails or p
117e0 61 73 73 65 73 2e 22 0a 20 20 20 20 65 63 68 6f  asses.".    echo
117f0 20 22 41 6c 6c 20 76 65 72 69 66 69 63 61 74 69   "All verificati
11800 6f 6e 20 63 6f 6d 6d 61 6e 64 73 20 72 65 74 75  on commands retu
11810 72 6e 20 61 20 73 74 72 69 6e 67 20 74 68 61 74  rn a string that
11820 20 22 0a 20 20 20 20 65 63 68 6f 20 22 62 65 6c   ".    echo "bel
11830 6f 6e 67 73 20 74 6f 20 74 68 65 20 73 65 74 20  ongs to the set 
11840 7b 5c 22 76 65 72 69 66 69 63 61 74 69 6f 6e 5f  {\"verification_
11850 70 61 73 73 65 64 5c 22 2c 20 22 0a 20 20 20 20  passed\", ".    
11860 65 63 68 6f 20 22 20 20 20 20 20 20 20 20 20 20  echo "          
11870 20 20 20 20 20 20 20 20 20 20 5c 22 76 65 72 69            \"veri
11880 66 69 63 61 74 69 6f 6e 5f 66 61 69 6c 65 64 5c  fication_failed\
11890 22 7d 2e 22 0a 20 20 20 20 65 63 68 6f 20 22 22  "}.".    echo ""
118a0 0a 20 20 20 20 65 63 68 6f 20 22 49 66 20 74 68  .    echo "If th
118b0 65 20 77 6f 72 6b 69 6e 67 20 64 69 72 65 63 74  e working direct
118c0 6f 72 79 20 63 6f 6e 74 61 69 6e 73 20 61 20 66  ory contains a f
118d0 6f 6c 64 65 72 20 6e 61 6d 65 64 20 5c 22 63 75  older named \"cu
118e0 73 74 6f 6d 5f 68 65 61 64 65 72 73 5c 22 20 61  stom_headers\" a
118f0 6e 64 20 22 0a 20 20 20 20 65 63 68 6f 20 22 74  nd ".    echo "t
11900 68 61 74 20 66 6f 6c 64 65 72 20 69 73 20 72 65  hat folder is re
11910 63 75 72 73 69 76 65 6c 79 20 72 65 61 64 61 62  cursively readab
11920 6c 65 2f 63 6f 70 79 61 62 6c 65 2c 20 74 68 65  le/copyable, the
11930 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 5c 22  n the command \"
11940 77 72 61 70 5c 22 20 22 0a 20 20 20 20 65 63 68  wrap\" ".    ech
11950 6f 20 22 61 64 64 73 20 74 68 61 74 20 66 6f 6c  o "adds that fol
11960 64 65 72 20 74 6f 20 74 68 65 20 68 65 61 64 65  der to the heade
11970 72 20 66 6f 6c 64 65 72 20 6f 66 20 74 68 65 20  r folder of the 
11980 6e 65 77 6c 79 20 63 72 65 61 74 65 64 20 53 69  newly created Si
11990 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b 65 74  lktorrent packet
119a0 2e 22 0a 20 20 20 20 65 63 68 6f 20 22 49 66 20  .".    echo "If 
119b0 74 68 65 72 65 20 69 73 20 61 20 66 61 69 6c 75  there is a failu
119c0 72 65 20 61 74 20 74 68 65 20 72 65 63 75 72 73  re at the recurs
119d0 69 76 65 20 63 6f 70 79 69 6e 67 20 6f 66 20 74  ive copying of t
119e0 68 65 20 5c 22 63 75 73 74 6f 6d 5f 68 65 61 64  he \"custom_head
119f0 65 72 73 5c 22 2c 20 22 0a 20 20 20 20 65 63 68  ers\", ".    ech
11a00 6f 20 22 74 68 65 6e 20 74 68 69 73 20 73 63 72  o "then this scr
11a10 69 70 74 20 65 78 69 74 73 20 77 69 74 68 20 61  ipt exits with a
11a20 20 6e 6f 6e 2d 30 20 65 72 72 6f 72 20 63 6f 64   non-0 error cod
11a30 65 20 22 0a 20 20 20 20 65 63 68 6f 20 22 62 65  e ".    echo "be
11a40 66 6f 72 65 20 74 68 65 20 53 69 6c 6b 74 6f 72  fore the Silktor
11a50 72 65 6e 74 20 70 61 63 6b 65 74 20 69 73 20 63  rent packet is c
11a60 72 65 61 74 65 64 2e 22 0a 20 20 20 20 65 63 68  reated.".    ech
11a70 6f 20 22 22 0a 20 20 20 20 65 63 68 6f 20 22 22  o "".    echo ""
11a80 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73  .} # func_mmmv_s
11a90 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61  ilktorrent_packa
11aa0 67 65 72 5f 74 31 5f 62 61 73 68 5f 70 72 69 6e  ger_t1_bash_prin
11ab0 74 5f 68 65 6c 70 5f 6d 73 67 5f 74 31 0a 0a 23  t_help_msg_t1..#
11ac0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11ad0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11ae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11af0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
11b00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63  ----------..func
11b10 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
11b20 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
11b30 73 68 5f 65 78 63 5f 61 73 73 65 72 74 5f 77 72  sh_exc_assert_wr
11b40 61 70 70 61 62 6c 65 5f 66 69 6c 65 5f 65 78 69  appable_file_exi
11b50 73 74 73 5f 74 31 28 29 20 7b 20 0a 20 20 20 20  sts_t1() { .    
11b60 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d 22 24 31  local S_FP_0="$1
11b70 22 20 23 20 50 61 74 68 20 74 6f 20 74 68 65 20  " # Path to the 
11b80 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d 2d 2d 2d  file. .    #----
11b90 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24  ----.    if [ "$
11ba0 53 5f 46 50 5f 30 22 20 3d 3d 20 22 22 20 5d 3b  S_FP_0" == "" ];
11bb0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
11bc0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
11bd0 68 6f 20 22 54 68 65 20 32 2e 20 63 6f 6e 73 6f  ho "The 2. conso
11be0 6c 65 20 61 72 67 75 6d 65 6e 74 20 69 73 20 65  le argument is e
11bf0 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 22 0a  xpected to be ".
11c00 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 61 20          echo "a 
11c10 70 61 74 68 20 74 6f 20 61 20 66 69 6c 65 2c 20  path to a file, 
11c20 62 75 74 20 63 75 72 72 65 6e 74 6c 79 20 22 0a  but currently ".
11c30 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 68          echo "th
11c40 65 20 32 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67  e 2. console arg
11c50 75 6d 65 6e 74 20 69 73 20 6d 69 73 73 69 6e 67  ument is missing
11c60 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
11c70 22 47 55 49 44 3d 3d 27 34 63 61 39 31 61 32 66  "GUID=='4ca91a2f
11c80 2d 32 38 62 64 2d 34 33 34 37 2d 38 31 30 66 2d  -28bd-4347-810f-
11c90 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
11ca0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
11cb0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
11cc0 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
11cd0 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
11ce0 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
11cf0 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23  ror.    fi.    #
11d00 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20  --------.    if 
11d10 5b 20 21 20 2d 65 20 22 24 53 5f 46 50 5f 30 22  [ ! -e "$S_FP_0"
11d20 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
11d30 20 69 66 20 5b 20 2d 68 20 22 24 53 5f 46 50 5f   if [ -h "$S_FP_
11d40 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
11d50 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
11d60 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
11d70 22 54 68 65 20 66 69 6c 65 20 70 61 74 68 20 22  "The file path "
11d80 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
11d90 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
11da0 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50   echo "    $S_FP
11db0 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
11dc0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
11dd0 20 20 20 20 65 63 68 6f 20 22 69 73 20 61 20 70      echo "is a p
11de0 61 74 68 20 6f 66 20 61 20 62 72 6f 6b 65 6e 20  ath of a broken 
11df0 73 79 6d 6c 69 6e 6b 2c 20 62 75 74 20 73 79 6d  symlink, but sym
11e00 6c 69 6e 6b 73 20 22 0a 20 20 20 20 20 20 20 20  links ".        
11e10 20 20 20 20 65 63 68 6f 20 22 61 72 65 20 6e 6f      echo "are no
11e20 74 20 73 75 70 70 6f 72 74 65 64 20 61 74 20 61  t supported at a
11e30 6c 6c 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  ll.".           
11e40 20 65 63 68 6f 20 22 54 68 65 20 72 65 61 73 6f   echo "The reaso
11e50 6e 2c 20 77 68 79 20 73 79 6d 6c 69 6e 6b 73 20  n, why symlinks 
11e60 74 6f 20 66 69 6c 65 73 20 61 72 65 20 6e 6f 74  to files are not
11e70 20 73 75 70 70 6f 72 74 65 64 20 69 73 20 74 68   supported is th
11e80 61 74 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  at ".           
11e90 20 65 63 68 6f 20 22 74 68 65 20 66 69 6c 65 20   echo "the file 
11ea0 73 69 7a 65 20 6f 66 20 73 79 6d 6c 69 6e 6b 73  size of symlinks
11eb0 20 63 61 6e 20 64 69 66 66 65 72 20 66 72 6f 6d   can differ from
11ec0 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65   ".            e
11ed0 63 68 6f 20 22 74 68 65 20 66 69 6c 65 20 73 69  cho "the file si
11ee0 7a 65 20 6f 66 20 74 68 65 20 74 61 72 67 65 74  ze of the target
11ef0 20 6f 66 20 74 68 65 20 73 79 6d 6c 69 6e 6b 2e   of the symlink.
11f00 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
11f10 68 6f 20 22 47 55 49 44 3d 3d 27 35 37 34 30 62  ho "GUID=='5740b
11f20 36 62 33 2d 39 30 62 34 2d 34 35 30 30 2d 38 31  6b3-90b4-4500-81
11f30 30 66 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  0f-802070e031e7'
11f40 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
11f50 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 6c  ho "".        el
11f60 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  se.            e
11f70 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
11f80 20 20 20 65 63 68 6f 20 22 54 68 65 20 66 69 6c     echo "The fil
11f90 65 20 77 69 74 68 20 74 68 65 20 70 61 74 68 20  e with the path 
11fa0 6f 66 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  of ".           
11fb0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
11fc0 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 24       echo "    $
11fd0 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20 20  S_FP_0".        
11fe0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
11ff0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f          echo "do
12000 65 73 20 6e 6f 74 20 65 78 69 73 74 2e 22 0a 20  es not exist.". 
12010 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
12020 22 47 55 49 44 3d 3d 27 38 37 63 31 36 64 32 31  "GUID=='87c16d21
12030 2d 65 37 38 62 2d 34 38 61 66 2d 62 36 66 65 2d  -e78b-48af-b6fe-
12040 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
12050 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
12060 22 22 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  "".        fi.  
12070 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
12080 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
12090 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31  G.        exit 1
120a0 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
120b0 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  or.    fi.    #-
120c0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
120d0 20 2d 64 20 22 24 53 5f 46 50 5f 30 22 20 5d 3b   -d "$S_FP_0" ];
120e0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69 66   then.        if
120f0 20 5b 20 2d 68 20 22 24 53 5f 46 50 5f 30 22 20   [ -h "$S_FP_0" 
12100 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
12110 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
12120 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
12130 65 20 70 61 74 68 20 22 0a 20 20 20 20 20 20 20  e path ".       
12140 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
12150 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20           echo " 
12160 20 20 20 24 53 5f 46 50 5f 30 22 0a 20 20 20 20     $S_FP_0".    
12170 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
12180 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
12190 20 22 72 65 66 65 72 65 6e 63 65 73 20 61 20 73   "references a s
121a0 79 6d 6c 69 6e 6b 20 74 68 61 74 20 72 65 66 65  ymlink that refe
121b0 72 65 6e 63 65 73 20 66 6f 6c 64 65 72 2c 20 62  rences folder, b
121c0 75 74 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  ut ".           
121d0 20 65 63 68 6f 20 22 61 20 66 69 6c 65 20 69 73   echo "a file is
121e0 20 65 78 70 65 63 74 65 64 2e 22 0a 20 20 20 20   expected.".    
121f0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
12200 49 44 3d 3d 27 39 61 64 36 63 64 35 64 2d 35 36  ID=='9ad6cd5d-56
12210 36 38 2d 34 33 35 66 2d 62 35 66 65 2d 38 30 32  68-435f-b5fe-802
12220 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
12230 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
12240 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20          else.   
12250 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
12260 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
12270 6f 20 22 54 68 65 20 70 61 74 68 20 22 0a 20 20  o "The path ".  
12280 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
12290 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
122a0 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 30 22  ho "    $S_FP_0"
122b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
122c0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
122d0 20 65 63 68 6f 20 22 72 65 66 65 72 65 6e 63 65   echo "reference
122e0 73 20 61 20 66 6f 6c 64 65 72 2c 20 62 75 74 20  s a folder, but 
122f0 69 74 20 69 73 20 65 78 70 65 63 74 65 64 20 74  it is expected t
12300 6f 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  o ".            
12310 65 63 68 6f 20 22 74 6f 20 72 65 66 65 72 65 6e  echo "to referen
12320 63 65 20 61 20 66 69 6c 65 2e 22 0a 20 20 20 20  ce a file.".    
12330 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
12340 49 44 3d 3d 27 33 65 39 35 35 65 61 35 2d 34 39  ID=='3e955ea5-49
12350 37 62 2d 34 64 32 35 2d 38 31 66 65 2d 38 30 32  7b-4d25-81fe-802
12360 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
12370 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
12380 20 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20          fi.     
12390 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
123a0 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
123b0 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
123c0 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
123d0 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
123e0 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 2d 68  ----.    if [ -h
123f0 20 22 24 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68   "$S_FP_0" ]; th
12400 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  en.        echo 
12410 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
12420 22 54 68 65 20 70 61 74 68 20 22 0a 20 20 20 20  "The path ".    
12430 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
12440 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 24 53      echo "    $S
12450 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65  _FP_0".        e
12460 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
12470 63 68 6f 20 22 72 65 66 65 72 65 6e 63 65 73 20  cho "references 
12480 61 20 73 79 6d 6c 69 6e 6b 2c 20 61 20 66 69 6c  a symlink, a fil
12490 65 20 69 73 20 65 78 70 65 63 74 65 64 2e 22 0a  e is expected.".
124a0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68          echo "Th
124b0 65 20 72 65 61 73 6f 6e 2c 20 77 68 79 20 73 79  e reason, why sy
124c0 6d 6c 69 6e 6b 73 20 74 6f 20 66 69 6c 65 73 20  mlinks to files 
124d0 61 72 65 20 6e 6f 74 20 73 75 70 70 6f 72 74 65  are not supporte
124e0 64 20 69 73 20 74 68 61 74 20 22 0a 20 20 20 20  d is that ".    
124f0 20 20 20 20 65 63 68 6f 20 22 74 68 65 20 66 69      echo "the fi
12500 6c 65 20 73 69 7a 65 20 6f 66 20 73 79 6d 6c 69  le size of symli
12510 6e 6b 73 20 63 61 6e 20 64 69 66 66 65 72 20 66  nks can differ f
12520 72 6f 6d 20 22 0a 20 20 20 20 20 20 20 20 65 63  rom ".        ec
12530 68 6f 20 22 74 68 65 20 66 69 6c 65 20 73 69 7a  ho "the file siz
12540 65 20 6f 66 20 74 68 65 20 74 61 72 67 65 74 20  e of the target 
12550 6f 66 20 74 68 65 20 73 79 6d 6c 69 6e 6b 2e 22  of the symlink."
12560 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47  .        echo "G
12570 55 49 44 3d 3d 27 39 35 33 38 33 63 36 39 2d 30  UID=='95383c69-0
12580 37 66 35 2d 34 37 63 30 2d 38 39 66 65 2d 38 30  7f5-47c0-89fe-80
12590 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20  2070e031e7'".   
125a0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
125b0 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
125c0 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
125d0 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20  .        exit 1 
125e0 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f  # exit with erro
125f0 72 0a 20 20 20 20 66 69 0a 7d 20 23 20 66 75 6e  r.    fi.} # fun
12600 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65  c_mmmv_silktorre
12610 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62  nt_packager_t1_b
12620 61 73 68 5f 65 78 63 5f 61 73 73 65 72 74 5f 77  ash_exc_assert_w
12630 72 61 70 70 61 62 6c 65 5f 66 69 6c 65 5f 65 78  rappable_file_ex
12640 69 73 74 73 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d  ists_t1...#-----
12650 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12660 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12670 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12680 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12690 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76  -----..func_mmmv
126a0 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
126b0 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65 78  kager_t1_bash_ex
126c0 63 5f 61 73 73 65 72 74 5f 70 61 63 6b 65 74 5f  c_assert_packet_
126d0 6e 61 6d 65 5f 63 61 6e 64 69 64 61 74 65 5f 65  name_candidate_e
126e0 78 69 73 74 73 5f 74 31 28 29 20 7b 20 0a 20 20  xists_t1() { .  
126f0 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d 22    local S_FP_0="
12700 24 31 22 20 23 20 50 61 74 68 20 74 6f 20 74 68  $1" # Path to th
12710 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d 2d  e file. .    #--
12720 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20  ------.    if [ 
12730 22 24 53 5f 46 50 5f 30 22 20 3d 3d 20 22 22 20  "$S_FP_0" == "" 
12740 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
12750 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
12760 65 63 68 6f 20 22 54 68 65 20 32 2e 20 63 6f 6e  echo "The 2. con
12770 73 6f 6c 65 20 61 72 67 75 6d 65 6e 74 20 69 73  sole argument is
12780 20 65 78 70 65 63 74 65 64 20 74 6f 20 62 65 20   expected to be 
12790 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
127a0 61 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61  a Silktorrent pa
127b0 63 6b 65 74 20 6e 61 6d 65 20 63 61 6e 64 69 64  cket name candid
127c0 61 74 65 2c 20 62 75 74 20 63 75 72 72 65 6e 74  ate, but current
127d0 6c 79 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  ly ".        ech
127e0 6f 20 22 74 68 65 20 32 2e 20 63 6f 6e 73 6f 6c  o "the 2. consol
127f0 65 20 61 72 67 75 6d 65 6e 74 20 69 73 20 6d 69  e argument is mi
12800 73 73 69 6e 67 2e 22 0a 20 20 20 20 20 20 20 20  ssing.".        
12810 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 33 31 65  echo "GUID=='31e
12820 35 34 64 30 33 2d 38 30 31 36 2d 34 33 36 62 2d  54d03-8016-436b-
12830 38 35 62 64 2d 38 30 32 30 37 30 65 30 33 31 65  85bd-802070e031e
12840 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
12850 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
12860 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
12870 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
12880 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
12890 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
128a0 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  } # func_mmmv_si
128b0 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
128c0 65 72 5f 74 31 5f 62 61 73 68 5f 65 78 63 5f 61  er_t1_bash_exc_a
128d0 73 73 65 72 74 5f 70 61 63 6b 65 74 5f 6e 61 6d  ssert_packet_nam
128e0 65 5f 63 61 6e 64 69 64 61 74 65 5f 65 78 69 73  e_candidate_exis
128f0 74 73 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  ts_t1...#-------
12900 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12910 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12920 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12930 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12940 2d 2d 2d 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56  ---..S_FUNC_MMMV
12950 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
12960 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45  KAGER_T1_BASH_RE
12970 56 45 52 53 45 5f 53 54 52 49 4e 47 5f 52 45 47  VERSE_STRING_REG
12980 49 53 54 45 52 3d 22 66 6f 72 20 69 6e 70 75 74  ISTER="for input
12990 20 61 6e 64 20 6f 75 74 70 75 74 22 0a 53 5f 46   and output".S_F
129a0 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52  UNC_MMMV_SILKTOR
129b0 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
129c0 5f 42 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54  _BASH_REVERSE_ST
129d0 52 49 4e 47 5f 4d 4f 44 45 3d 22 22 20 23 20 6f  RING_MODE="" # o
129e0 70 74 69 6d 2e 20 20 68 61 63 6b 0a 66 75 6e 63  ptim.  hack.func
129f0 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
12a00 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
12a10 73 68 5f 72 65 76 65 72 73 65 5f 73 74 72 69 6e  sh_reverse_strin
12a20 67 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c  g() { .    local
12a30 20 53 5f 49 4e 3d 22 24 53 5f 46 55 4e 43 5f 4d   S_IN="$S_FUNC_M
12a40 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  MMV_SILKTORRENT_
12a50 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48  PACKAGER_T1_BASH
12a60 5f 52 45 56 45 52 53 45 5f 53 54 52 49 4e 47 5f  _REVERSE_STRING_
12a70 52 45 47 49 53 54 45 52 22 0a 20 20 20 20 23 2d  REGISTER".    #-
12a80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12a90 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  ---.    local S_
12aa0 54 4d 50 5f 30 3d 22 22 20 23 20 64 65 63 6c 61  TMP_0="" # decla
12ab0 72 61 74 69 6f 6e 0a 20 20 20 20 23 20 4d 6f 64  ration.    # Mod
12ac0 65 20 73 65 6c 65 63 74 69 6f 6e 3a 0a 20 20 20  e selection:.   
12ad0 20 69 66 20 5b 20 22 24 53 5f 46 55 4e 43 5f 4d   if [ "$S_FUNC_M
12ae0 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  MMV_SILKTORRENT_
12af0 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48  PACKAGER_T1_BASH
12b00 5f 52 45 56 45 52 53 45 5f 53 54 52 49 4e 47 5f  _REVERSE_STRING_
12b10 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d 20 3b 20  MODE" == "" ] ; 
12b20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f  then.        SB_
12b30 45 58 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54  EXISTS_ON_PATH_T
12b40 31 5f 52 45 53 55 4c 54 3d 22 66 22 20 20 23 20  1_RESULT="f"  # 
12b50 69 66 2d 62 6c 6f 63 6b 20 69 6e 69 74 0a 20 20  if-block init.  
12b60 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
12b70 20 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58      if [ "$SB_EX
12b80 49 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f  ISTS_ON_PATH_T1_
12b90 52 45 53 55 4c 54 22 20 3d 3d 20 22 66 22 20 5d  RESULT" == "f" ]
12ba0 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
12bb0 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 72 75 62      S_TMP_0="rub
12bc0 79 22 20 20 20 20 23 20 68 65 6c 70 73 20 6f 6e  y"    # helps on
12bd0 20 42 53 44 0a 20 20 20 20 20 20 20 20 20 20 20   BSD.           
12be0 20 66 75 6e 63 5f 73 62 5f 65 78 69 73 74 73 5f   func_sb_exists_
12bf0 6f 6e 5f 70 61 74 68 5f 74 31 20 22 24 53 5f 54  on_path_t1 "$S_T
12c00 4d 50 5f 30 22 20 0a 20 20 20 20 20 20 20 20 20  MP_0" .         
12c10 20 20 20 69 66 20 5b 20 22 24 53 42 5f 45 58 49     if [ "$SB_EXI
12c20 53 54 53 5f 4f 4e 5f 50 41 54 48 5f 54 31 5f 52  STS_ON_PATH_T1_R
12c30 45 53 55 4c 54 22 20 3d 3d 20 22 74 22 20 5d 20  ESULT" == "t" ] 
12c40 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20  ; then.         
12c50 20 20 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d          S_FUNC_M
12c60 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  MMV_SILKTORRENT_
12c70 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48  PACKAGER_T1_BASH
12c80 5f 52 45 56 45 52 53 45 5f 53 54 52 49 4e 47 5f  _REVERSE_STRING_
12c90 4d 4f 44 45 3d 22 24 53 5f 54 4d 50 5f 30 22 0a  MODE="$S_TMP_0".
12ca0 20 20 20 20 20 20 20 20 20 20 20 20 66 69 0a 20              fi. 
12cb0 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
12cc0 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
12cd0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
12ce0 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45  C_MMMV_SILKTORRE
12cf0 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42  NT_PACKAGER_T1_B
12d00 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54 52 49  ASH_REVERSE_STRI
12d10 4e 47 5f 4d 4f 44 45 22 20 3d 3d 20 22 22 20 5d  NG_MODE" == "" ]
12d20 20 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20   ; then.        
12d30 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
12d40 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 41 6c          echo "Al
12d50 6c 20 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61  l of the applica
12d60 74 69 6f 6e 73 20 74 68 61 74 20 74 68 69 73 20  tions that this 
12d70 66 75 6e 63 74 69 6f 6e 20 69 73 20 22 20 0a 20  function is " . 
12d80 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
12d90 22 63 61 70 61 62 6c 65 20 6f 66 20 75 73 69 6e  "capable of usin
12da0 67 20 66 6f 72 20 72 65 76 65 72 73 69 6e 67 20  g for reversing 
12db0 61 20 73 74 72 69 6e 67 28 72 75 62 79 29 22 0a  a string(ruby)".
12dc0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
12dd0 20 22 61 72 65 20 6d 69 73 73 69 6e 67 20 66 72   "are missing fr
12de0 6f 6d 20 74 68 65 20 50 41 54 48 2e 22 0a 20 20  om the PATH.".  
12df0 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
12e00 47 55 49 44 3d 3d 27 38 35 62 62 66 36 31 32 2d  GUID=='85bbf612-
12e10 30 61 32 62 2d 34 38 35 66 2d 62 34 62 64 2d 38  0a2b-485f-b4bd-8
12e20 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20  02070e031e7'".  
12e30 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
12e40 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 2d  ".            #-
12e50 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20  ---.            
12e60 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
12e70 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31            exit 1
12e80 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
12e90 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  or.        fi.  
12ea0 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a        #--------.
12eb0 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 3f          if [ "$?
12ec0 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e  " != "0" ]; then
12ed0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
12ee0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
12ef0 20 65 63 68 6f 20 22 54 68 69 73 20 73 63 72 69   echo "This scri
12f00 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20  pt is flawed.". 
12f10 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
12f20 22 47 55 49 44 3d 3d 27 65 37 37 39 62 65 35 32  "GUID=='e779be52
12f30 2d 33 62 31 61 2d 34 30 32 65 2d 39 31 62 64 2d  -3b1a-402e-91bd-
12f40 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
12f50 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
12f60 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  "".            #
12f70 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20  ----.           
12f80 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
12f90 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20             exit 
12fa0 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
12fb0 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20  ror.        fi. 
12fc0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d         #--------
12fd0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
12fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12ff0 2d 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d  -.    S_FUNC_MMM
13000 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  V_SILKTORRENT_PA
13010 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 52  CKAGER_T1_BASH_R
13020 45 56 45 52 53 45 5f 53 54 52 49 4e 47 5f 52 45  EVERSE_STRING_RE
13030 47 49 53 54 45 52 3d 22 22 0a 20 20 20 20 23 2d  GISTER="".    #-
13040 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
13050 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53   "$S_FUNC_MMMV_S
13060 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
13070 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45 56 45  GER_T1_BASH_REVE
13080 52 53 45 5f 53 54 52 49 4e 47 5f 4d 4f 44 45 22  RSE_STRING_MODE"
13090 20 3d 3d 20 22 72 75 62 79 22 20 5d 3b 20 74 68   == "ruby" ]; th
130a0 65 6e 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  en.        #----
130b0 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 30  .        S_TMP_0
130c0 3d 22 60 72 75 62 79 20 2d 65 20 5c 22 70 75 74  ="`ruby -e \"put
130d0 73 28 41 52 47 56 5b 30 5d 2e 74 6f 5f 73 2e 72  s(ARGV[0].to_s.r
130e0 65 76 65 72 73 65 29 5c 22 20 22 24 53 5f 49 4e  everse)\" "$S_IN
130f0 22 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 60 22 0a  " 2>/dev/null`".
13100 20 20 20 20 20 20 20 20 69 66 20 5b 20 22 24 3f          if [ "$?
13110 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e  " != "0" ]; then
13120 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
13130 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
13140 20 65 63 68 6f 20 22 54 68 65 20 63 6f 6e 73 6f   echo "The conso
13150 6c 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 5c  le application \
13160 22 72 75 62 79 5c 22 20 22 0a 20 20 20 20 20 20  "ruby\" ".      
13170 20 20 20 20 20 20 65 63 68 6f 20 22 65 78 69 74        echo "exit
13180 65 64 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72  ed with an error
13190 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  .".            e
131a0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
131b0 20 20 20 65 63 68 6f 20 22 2d 2d 2d 2d 63 6f 6e     echo "----con
131c0 73 6f 6c 65 2d 2d 6f 75 74 70 75 74 2d 2d 63 69  sole--output--ci
131d0 74 61 74 69 6f 6e 2d 2d 73 74 61 72 74 2d 2d 2d  tation--start---
131e0 2d 2d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  --".            
131f0 65 63 68 6f 20 22 60 72 75 62 79 20 2d 65 20 5c  echo "`ruby -e \
13200 22 70 75 74 73 28 27 24 53 5f 49 4e 27 2e 72 65  "puts('$S_IN'.re
13210 76 65 72 73 65 29 5c 22 60 22 20 23 20 77 69 74  verse)\"`" # wit
13220 68 20 74 68 65 20 73 74 64 65 72 72 0a 20 20 20  h the stderr.   
13230 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 2d           echo "-
13240 2d 2d 2d 63 6f 6e 73 6f 6c 65 2d 2d 6f 75 74 70  ---console--outp
13250 75 74 2d 2d 63 69 74 61 74 69 6f 6e 2d 2d 65 6e  ut--citation--en
13260 64 2d 2d 2d 2d 2d 2d 2d 22 0a 20 20 20 20 20 20  d-------".      
13270 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
13280 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
13290 47 55 49 44 3d 3d 27 33 32 62 35 39 32 35 38 2d  GUID=='32b59258-
132a0 66 37 64 36 2d 34 61 38 33 2d 39 35 62 64 2d 38  f7d6-4a83-95bd-8
132b0 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20 20  02070e031e7'".  
132c0 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
132d0 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 2d  ".            #-
132e0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20 20  ---.            
132f0 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
13300 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31            exit 1
13310 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72 72   # exit with err
13320 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20 20  or.        fi.  
13330 20 20 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d        S_FUNC_MMM
13340 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  V_SILKTORRENT_PA
13350 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 52  CKAGER_T1_BASH_R
13360 45 56 45 52 53 45 5f 53 54 52 49 4e 47 5f 52 45  EVERSE_STRING_RE
13370 47 49 53 54 45 52 3d 22 24 53 5f 54 4d 50 5f 30  GISTER="$S_TMP_0
13380 22 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  ".    fi.    #--
13390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
133a0 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  --.} # func_mmmv
133b0 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
133c0 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 72 65  kager_t1_bash_re
133d0 76 65 72 73 65 5f 73 74 72 69 6e 67 0a 0a 0a 23  verse_string...#
133e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
133f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13410 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13420 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 23 20 41 73  ----------..# As
13430 20 6f 66 20 32 30 31 36 20 74 68 65 20 6d 61 78   of 2016 the max
13440 69 6d 75 6d 20 66 69 6c 65 20 6e 61 6d 65 20 6c  imum file name l
13450 65 6e 67 74 68 20 6f 6e 20 4c 69 6e 75 78 20 69  ength on Linux i
13460 73 20 32 35 35 20 63 68 61 72 61 63 74 65 72 73  s 255 characters
13470 2e 0a 23 20 41 74 0a 23 0a 23 20 20 20 20 68 74  ..# At.#.#    ht
13480 74 70 3a 2f 2f 75 6e 69 78 2e 73 74 61 63 6b 65  tp://unix.stacke
13490 78 63 68 61 6e 67 65 2e 63 6f 6d 2f 71 75 65 73  xchange.com/ques
134a0 74 69 6f 6e 73 2f 33 32 37 39 35 2f 77 68 61 74  tions/32795/what
134b0 2d 69 73 2d 74 68 65 2d 6d 61 78 69 6d 75 6d 2d  -is-the-maximum-
134c0 61 6c 6c 6f 77 65 64 2d 66 69 6c 65 6e 61 6d 65  allowed-filename
134d0 2d 61 6e 64 2d 66 6f 6c 64 65 72 2d 73 69 7a 65  -and-folder-size
134e0 2d 77 69 74 68 2d 65 63 72 79 70 74 66 73 0a 23  -with-ecryptfs.#
134f0 0a 23 20 74 68 65 20 65 43 72 79 70 74 66 73 20  .# the eCryptfs 
13500 72 65 6c 61 74 65 64 20 72 65 63 6f 6d 6d 65 6e  related recommen
13510 64 61 74 69 6f 6e 20 69 73 20 74 6f 20 6b 65 65  dation is to kee
13520 70 20 74 68 65 20 6c 65 6e 67 74 68 73 0a 23 20  p the lengths.# 
13530 6f 66 20 66 69 6c 65 20 6e 61 6d 65 73 20 74 6f  of file names to
13540 20 6c 65 73 73 20 74 68 61 6e 20 31 34 30 20 63   less than 140 c
13550 68 61 72 61 63 74 65 72 73 2e 20 0a 23 0a 23 20  haracters. .#.# 
13560 41 20 63 69 74 61 74 69 6f 6e 20 66 72 6f 6d 20  A citation from 
13570 0a 23 20 68 74 74 70 3a 2f 2f 77 69 6e 64 6f 77  .# http://window
13580 73 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f  s.microsoft.com/
13590 65 6e 2d 75 73 2f 77 69 6e 64 6f 77 73 2f 66 69  en-us/windows/fi
135a0 6c 65 2d 6e 61 6d 65 73 2d 65 78 74 65 6e 73 69  le-names-extensi
135b0 6f 6e 73 2d 66 61 71 23 31 54 43 3d 77 69 6e 64  ons-faq#1TC=wind
135c0 6f 77 73 2d 37 0a 23 20 61 72 63 68 69 76 61 6c  ows-7.# archival
135d0 20 63 6f 70 79 3a 20 68 74 74 70 73 3a 2f 2f 61   copy: https://a
135e0 72 63 68 69 76 65 2e 69 73 2f 55 4b 42 6d 64 0a  rchive.is/UKBmd.
135f0 23 20 20 20 20 20 22 57 69 6e 64 6f 77 73 20 6c  #     "Windows l
13600 69 6d 69 74 73 20 61 20 73 69 6e 67 6c 65 20 70  imits a single p
13610 61 74 68 20 74 6f 20 32 36 30 20 63 68 61 72 61  ath to 260 chara
13620 63 74 65 72 73 2e 22 0a 23 0a 23 20 41 20 63 69  cters.".#.# A ci
13630 74 61 74 69 6f 6e 20 66 72 6f 6d 20 43 79 67 57  tation from CygW
13640 69 6e 20 6d 61 69 6c 69 6e 67 20 6c 69 73 74 3a  in mailing list:
13650 0a 23 20 68 74 74 70 73 3a 2f 2f 63 79 67 77 69  .# https://cygwi
13660 6e 2e 63 6f 6d 2f 6d 6c 2f 63 79 67 77 69 6e 2f  n.com/ml/cygwin/
13670 32 30 30 34 2d 31 30 2f 6d 73 67 30 31 33 32 33  2004-10/msg01323
13680 2e 68 74 6d 6c 0a 23 20 61 72 63 68 69 76 61 6c  .html.# archival
13690 20 63 6f 70 79 3a 20 68 74 74 70 73 3a 2f 2f 61   copy: https://a
136a0 72 63 68 69 76 65 2e 69 73 2f 47 52 76 46 4b 0a  rchive.is/GRvFK.
136b0 23 20 20 20 20 20 22 54 68 65 20 55 6e 69 63 6f  #     "The Unico
136c0 64 65 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 73  de versions of s
136d0 65 76 65 72 61 6c 20 66 75 6e 63 74 69 6f 6e 73  everal functions
136e0 20 70 65 72 6d 69 74 20 61 20 0a 23 20 20 20 20   permit a .#    
136f0 20 6d 61 78 69 6d 75 6d 20 70 61 74 68 20 6c 65   maximum path le
13700 6e 67 74 68 20 6f 66 20 33 32 2c 37 36 37 20 63  ngth of 32,767 c
13710 68 61 72 61 63 74 65 72 73 2c 20 0a 23 20 20 20  haracters, .#   
13720 20 20 63 6f 6d 70 6f 73 65 64 20 6f 66 20 63 6f    composed of co
13730 6d 70 6f 6e 65 6e 74 73 20 75 70 20 74 6f 20 32  mponents up to 2
13740 35 35 20 63 68 61 72 61 63 74 65 72 73 20 69 6e  55 characters in
13750 20 6c 65 6e 67 74 68 2e 20 0a 23 20 20 20 20 20   length. .#     
13760 54 6f 20 73 70 65 63 69 66 79 20 73 75 63 68 20  To specify such 
13770 61 20 70 61 74 68 2c 20 75 73 65 20 74 68 65 20  a path, use the 
13780 22 5c 5c 3f 5c 22 20 70 72 65 66 69 78 2e 20 46  "\\?\" prefix. F
13790 6f 72 20 65 78 61 6d 70 6c 65 2c 20 0a 23 20 20  or example, .#  
137a0 20 20 20 22 5c 5c 3f 5c 44 3a 5c 3c 70 61 74 68     "\\?\D:\<path
137b0 3e 22 2e 20 54 6f 20 73 70 65 63 69 66 79 20 73  >". To specify s
137c0 75 63 68 20 61 20 55 4e 43 20 70 61 74 68 2c 20  uch a UNC path, 
137d0 75 73 65 20 74 68 65 20 22 5c 5c 3f 5c 55 4e 43  use the "\\?\UNC
137e0 5c 22 20 0a 23 20 20 20 20 20 70 72 65 66 69 78  \" .#     prefix
137f0 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 22  . For example, "
13800 5c 5c 3f 5c 55 4e 43 5c 3c 73 65 72 76 65 72 3e  \\?\UNC\<server>
13810 5c 3c 73 68 61 72 65 3e 22 2e 20 0a 23 20 20 20  \<share>". .#   
13820 20 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 73    Note that thes
13830 65 20 70 72 65 66 69 78 65 73 20 61 72 65 20 6e  e prefixes are n
13840 6f 74 20 75 73 65 64 20 61 73 20 70 61 72 74 20  ot used as part 
13850 6f 66 20 74 68 65 20 70 61 74 68 20 0a 23 20 20  of the path .#  
13860 20 20 20 69 74 73 65 6c 66 2e 20 54 68 65 79 20     itself. They 
13870 69 6e 64 69 63 61 74 65 20 74 68 61 74 20 74 68  indicate that th
13880 65 20 70 61 74 68 20 73 68 6f 75 6c 64 20 62 65  e path should be
13890 20 70 61 73 73 65 64 20 74 6f 20 74 68 65 20 0a   passed to the .
138a0 23 20 20 20 20 20 73 79 73 74 65 6d 20 77 69 74  #     system wit
138b0 68 20 6d 69 6e 69 6d 61 6c 20 6d 6f 64 69 66 69  h minimal modifi
138c0 63 61 74 69 6f 6e 2e 20 41 6e 20 69 6d 70 6c 69  cation. An impli
138d0 63 61 74 69 6f 6e 20 6f 66 20 74 68 69 73 20 69  cation of this i
138e0 73 20 0a 23 20 20 20 20 20 74 68 61 74 20 79 6f  s .#     that yo
138f0 75 20 63 61 6e 6e 6f 74 20 75 73 65 20 66 6f 72  u cannot use for
13900 77 61 72 64 20 73 6c 61 73 68 65 73 20 74 6f 20  ward slashes to 
13910 72 65 70 72 65 73 65 6e 74 20 70 61 74 68 20 73  represent path s
13920 65 70 61 72 61 74 6f 72 73 20 0a 23 20 20 20 20  eparators .#    
13930 20 6f 72 20 61 20 70 65 72 69 6f 64 20 74 6f 20   or a period to 
13940 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 63 75  represent the cu
13950 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 2e  rrent directory.
13960 22 0a 23 20 52 65 6c 61 74 65 64 20 70 61 67 65  ".# Related page
13970 73 3a 0a 23 20 68 74 74 70 73 3a 2f 2f 6d 73 64  s:.# https://msd
13980 6e 2e 6d 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f  n.microsoft.com/
13990 65 6e 2d 75 73 2f 6c 69 62 72 61 72 79 2f 61 61  en-us/library/aa
139a0 33 36 35 32 34 37 28 56 53 2e 38 35 29 2e 61 73  365247(VS.85).as
139b0 70 78 0a 23 20 61 72 63 68 69 76 61 6c 20 63 6f  px.# archival co
139c0 70 79 3a 20 68 74 74 70 73 3a 2f 2f 61 72 63 68  py: https://arch
139d0 69 76 65 2e 69 73 2f 70 38 39 31 79 0a 23 0a 23  ive.is/p891y.#.#
139e0 20 54 6f 20 61 6c 6c 6f 77 20 64 61 74 61 62 61   To allow databa
139f0 73 65 20 69 6e 64 65 78 65 73 20 74 68 61 74 20  se indexes that 
13a00 73 74 6f 72 65 20 74 68 65 20 0a 23 20 66 69 6c  store the .# fil
13a10 65 20 6e 61 6d 65 73 20 6f 66 20 74 68 65 20 62  e names of the b
13a20 6c 6f 67 73 20 0a 23 20 74 6f 20 77 6f 72 6b 20  logs .# to work 
13a30 61 73 20 65 66 66 69 63 69 65 6e 74 6c 79 20 61  as efficiently a
13a40 73 20 70 6f 73 73 69 62 6c 65 2c 20 74 68 65 20  s possible, the 
13a50 66 69 72 73 74 0a 23 20 63 68 61 72 61 63 74 65  first.# characte
13a60 72 73 20 6f 66 20 74 68 65 20 66 69 6c 65 20 6e  rs of the file n
13a70 61 6d 65 20 73 68 6f 75 6c 64 20 62 65 20 61 73  ame should be as
13a80 20 0a 23 20 75 6e 69 66 6f 72 6d 6c 79 20 72 61   .# uniformly ra
13a90 6e 64 6f 6d 20 73 65 74 20 6f 66 20 63 68 61 72  ndom set of char
13aa0 61 63 74 65 72 73 20 61 73 20 70 6f 73 73 69 62  acters as possib
13ab0 6c 65 2e 0a 23 20 49 66 20 66 69 6c 65 20 6e 61  le..# If file na
13ac0 6d 65 20 73 74 61 72 74 73 20 77 69 74 68 20 61  me starts with a
13ad0 20 73 65 63 75 72 65 20 68 61 73 68 2c 20 74 68   secure hash, th
13ae0 65 6e 20 0a 23 20 74 68 61 74 20 72 65 71 75 69  en .# that requi
13af0 72 65 6d 65 6e 74 20 69 73 20 6d 65 74 2e 20 0a  rement is met. .
13b00 23 0a 23 20 54 68 65 20 70 61 72 73 65 72 20 74  #.# The parser t
13b10 68 61 74 20 64 69 73 6d 61 6e 74 6c 65 73 20 74  hat dismantles t
13b20 68 65 20 66 69 6c 65 20 6e 61 6d 65 20 74 6f 20  he file name to 
13b30 72 65 6c 65 76 61 6e 74 20 63 6f 6d 70 6f 6e 65  relevant compone
13b40 6e 74 73 20 0a 23 20 73 68 6f 75 6c 64 20 62 65  nts .# should be
13b50 20 69 6d 70 6c 65 6d 65 6e 74 61 62 6c 65 20 69   implementable i
13b60 6e 20 64 69 66 66 65 72 65 6e 74 20 70 72 6f 67  n different prog
13b70 72 61 6d 6d 69 6e 67 20 6c 61 6e 67 75 61 67 65  ramming language
13b80 73 0a 23 20 77 69 74 68 6f 75 74 20 69 6e 76 65  s.# without inve
13b90 73 74 69 6e 67 20 63 6f 6e 73 69 64 65 72 61 62  sting considerab
13ba0 6c 65 20 61 6d 6f 75 6e 74 20 6f 66 20 64 65 76  le amount of dev
13bb0 65 6c 6f 70 6d 65 6e 74 20 74 69 6d 65 2e 0a 23  elopment time..#
13bc0 20 54 68 65 20 73 79 6e 74 61 78 20 6f 66 20 74   The syntax of t
13bd0 68 65 20 66 69 6c 65 20 6e 61 6d 65 20 73 68 6f  he file name sho
13be0 75 6c 64 20 61 6c 73 6f 20 61 6c 6c 6f 77 20 74  uld also allow t
13bf0 68 65 0a 23 20 66 69 6c 65 20 6e 61 6d 65 20 74  he.# file name t
13c00 6f 20 62 65 20 70 61 72 73 65 64 20 63 6f 6d 70  o be parsed comp
13c10 75 74 61 74 69 6f 6e 61 6c 6c 79 20 63 68 65 61  utationally chea
13c20 70 6c 79 2e 0a 23 0a 23 20 41 73 20 6f 66 20 32  ply..#.# As of 2
13c30 30 31 36 5f 30 35 20 74 68 65 20 66 69 6c 65 20  016_05 the file 
13c40 65 78 74 65 6e 73 69 6f 6e 20 20 2e 73 74 62 6c  extension  .stbl
13c50 6f 62 20 73 65 65 6d 73 20 74 6f 20 62 65 20 75  ob seems to be u
13c60 6e 75 73 65 64 2e 0a 23 20 54 68 65 72 65 66 6f  nused..# Therefo
13c70 72 65 20 74 68 65 20 22 73 69 6c 6b 74 6f 72 72  re the "silktorr
13c80 65 6e 74 20 62 6c 6f 62 22 2c 20 2e 73 74 62 6c  ent blob", .stbl
13c90 6f 62 2c 20 63 61 6e 20 62 65 20 75 73 65 64 20  ob, can be used 
13ca0 66 6f 72 20 74 68 65 20 0a 23 20 65 78 74 65 6e  for the .# exten
13cb0 73 69 6f 6e 20 6f 66 20 74 68 65 20 62 6c 6f 62  sion of the blob
13cc0 20 66 69 6c 65 73 2e 0a 23 0a 23 20 43 6f 6d 70   files..#.# Comp
13cd0 72 65 73 73 69 6f 6e 20 6f 66 20 74 68 65 20 62  ression of the b
13ce0 6c 6f 62 73 20 49 53 20 4e 4f 54 20 41 4c 4c 4f  lobs IS NOT ALLO
13cf0 57 45 44 2c 20 62 65 63 61 75 73 65 20 74 68 65  WED, because the
13d00 20 0a 23 20 62 6c 6f 62 73 20 6d 75 73 74 20 62   .# blobs must b
13d10 65 20 65 78 74 72 61 63 74 61 62 6c 65 20 77 69  e extractable wi
13d20 74 68 6f 75 74 20 62 65 63 6f 6d 69 6e 67 20 61  thout becoming a
13d30 20 76 69 63 74 69 6d 20 0a 23 20 6f 66 20 61 6e   victim .# of an
13d40 20 61 74 74 61 63 6b 2c 20 77 68 65 72 65 20 31   attack, where 1
13d50 30 30 47 69 42 20 6f 66 20 7a 65 72 6f 73 20 69  00GiB of zeros i
13d60 73 20 70 61 63 6b 65 64 20 74 6f 20 61 0a 23 20  s packed to a.# 
13d70 73 6d 61 6c 6c 20 66 69 6c 65 2e 20 54 68 65 20  small file. The 
13d80 63 6f 6e 74 61 69 6e 65 72 20 66 6f 72 6d 61 74  container format
13d90 20 69 73 20 74 68 65 20 74 61 72 20 66 6f 72 6d   is the tar form
13da0 61 74 2c 0a 23 20 77 69 74 68 6f 75 74 20 61 6e  at,.# without an
13db0 79 20 63 6f 6d 70 72 65 73 73 69 6f 6e 2e 0a 53  y compression..S
13dc0 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54  _FUNC_MMMV_SILKT
13dd0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
13de0 54 31 5f 42 41 53 48 5f 42 4c 4f 42 32 46 49 4c  T1_BASH_BLOB2FIL
13df0 45 4e 41 4d 45 5f 54 31 5f 52 45 53 55 4c 54 3d  ENAME_T1_RESULT=
13e00 22 6e 6f 74 20 73 65 74 22 0a 66 75 6e 63 5f 6d  "not set".func_m
13e10 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  mmv_silktorrent_
13e20 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68  packager_t1_bash
13e30 5f 62 6c 6f 62 32 66 69 6c 65 6e 61 6d 65 5f 74  _blob2filename_t
13e40 31 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c  1() { .    local
13e50 20 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 50   S_FP_0="$1" # P
13e60 61 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 2e  ath to the file.
13e70 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20   .    #----.    
13e80 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
13e90 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
13ea0 31 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72  1_bash_exc_asser
13eb0 74 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65  t_wrappable_file
13ec0 5f 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f 46  _exists_t1 "$S_F
13ed0 50 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  P_0".    #------
13ee0 2d 2d 0a 20 20 20 20 23 20 54 68 65 20 54 69 67  --.    # The Tig
13ef0 65 72 20 20 20 20 20 68 61 73 68 20 68 61 73 20  er     hash has 
13f00 20 34 38 20 63 68 61 72 61 63 74 65 72 73 2e 0a   48 characters..
13f10 20 20 20 20 23 20 54 68 65 20 57 68 69 72 6c 70      # The Whirlp
13f20 6f 6f 6c 20 68 61 73 68 20 68 61 73 20 31 32 38  ool hash has 128
13f30 20 63 68 61 72 61 63 74 65 72 73 2e 0a 20 20 20   characters..   
13f40 20 23 20 54 68 65 20 53 48 41 2d 32 35 36 20 20   # The SHA-256  
13f50 20 68 61 73 68 20 68 61 73 20 20 36 34 20 63 68   hash has  64 ch
13f60 61 72 61 63 74 65 72 73 2e 0a 20 20 20 20 23 0a  aracters..    #.
13f70 20 20 20 20 23 20 41 20 66 69 6c 65 20 73 69 7a      # A file siz
13f80 65 20 6f 66 20 31 54 69 42 20 69 73 20 7e 31 30  e of 1TiB is ~10
13f90 5e 31 32 20 7e 20 31 33 20 63 68 61 72 61 63 74  ^12 ~ 13 charact
13fa0 65 72 73 0a 20 20 20 20 23 20 41 20 66 69 6c 65  ers.    # A file
13fb0 20 73 69 7a 65 20 6f 66 20 31 50 69 42 20 69 73   size of 1PiB is
13fc0 20 7e 31 30 5e 31 35 20 7e 20 31 34 20 63 68 61   ~10^15 ~ 14 cha
13fd0 72 61 63 74 65 72 73 0a 20 20 20 20 23 20 41 20  racters.    # A 
13fe0 66 69 6c 65 20 73 69 7a 65 20 6f 66 20 31 45 69  file size of 1Ei
13ff0 42 20 69 73 20 7e 31 30 5e 31 38 20 7e 20 31 39  B is ~10^18 ~ 19
14000 20 63 68 61 72 61 63 74 65 72 73 0a 20 20 20 20   characters.    
14010 23 20 41 20 66 69 6c 65 20 73 69 7a 65 20 6f 66  # A file size of
14020 20 31 5a 69 42 20 69 73 20 7e 31 30 5e 32 31 20   1ZiB is ~10^21 
14030 7e 20 32 32 20 63 68 61 72 61 63 74 65 72 73 0a  ~ 22 characters.
14040 20 20 20 20 23 20 41 20 66 69 6c 65 20 73 69 7a      # A file siz
14050 65 20 6f 66 20 31 59 69 42 20 69 73 20 7e 31 30  e of 1YiB is ~10
14060 5e 32 34 20 7e 20 32 35 20 63 68 61 72 61 63 74  ^24 ~ 25 charact
14070 65 72 73 0a 20 20 20 20 23 20 0a 20 20 20 20 23  ers.    # .    #
14080 20 54 68 65 20 6d 61 78 2e 20 66 69 6c 65 20 6e   The max. file n
14090 61 6d 65 20 6c 65 6e 67 74 68 20 6f 6e 20 4c 69  ame length on Li
140a0 6e 75 78 20 61 6e 64 20 0a 20 20 20 20 23 20 57  nux and .    # W
140b0 69 6e 64 6f 77 73 20 28 55 6e 69 63 6f 64 65 20  indows (Unicode 
140c0 41 50 49 29 20 69 73 20 32 35 35 20 63 68 61 72  API) is 255 char
140d0 61 63 74 65 72 73 2e 0a 20 20 20 20 23 2d 2d 2d  acters..    #---
140e0 2d 0a 20 20 20 20 23 20 54 68 65 20 63 68 61 72  -.    # The char
140f0 61 63 74 65 72 20 62 75 64 67 65 74 3a 0a 20 20  acter budget:.  
14100 20 20 23 20 20 20 20 20 20 20 20 36 20 63 68 61    #        6 cha
14110 72 61 63 74 65 72 73 20 2d 2d 2d 20 66 69 6c 65  racters --- file
14120 20 6e 61 6d 65 20 66 6f 72 6d 61 74 20 74 79 70   name format typ
14130 65 20 49 44 20 0a 20 20 20 20 23 20 20 20 20 20  e ID .    #     
14140 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14150 20 20 20 20 72 67 78 5f 69 6e 5f 72 75 62 79 3d      rgx_in_ruby=
14160 2f 76 5b 5c 64 5d 7b 34 7d 5b 5f 5d 2f 0a 20 20  /v[\d]{4}[_]/.  
14170 20 20 23 20 65 63 68 6f 20 22 76 30 30 33 34 5f    # echo "v0034_
14180 73 32 33 34 32 5f 22 20 7c 20 67 61 77 6b 20 27  s2342_" | gawk '
14190 7b 20 67 73 75 62 28 2f 5f 2f 2c 20 22 5f 5c 6e  { gsub(/_/, "_\n
141a0 22 29 3b 20 70 72 69 6e 74 20 7d 27 20 7c 20 5c  "); print }' | \
141b0 0a 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20  .    #          
141c0 20 20 20 20 20 20 20 20 20 20 20 20 20 67 61 77               gaw
141d0 6b 20 27 2f 5e 76 5b 30 2d 39 5d 7b 34 7d 5f 2f  k '/^v[0-9]{4}_/
141e0 20 7b 70 72 69 6e 74 66 20 22 25 73 22 2c 24 31   {printf "%s",$1
141f0 20 7d 27 20 7c 20 5c 0a 20 20 20 20 23 20 20 20   }' | \.    #   
14200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14210 20 20 20 20 67 61 77 6b 20 27 7b 67 73 75 62 28      gawk '{gsub(
14220 2f 5b 76 5f 5d 2f 2c 22 22 29 3b 70 72 69 6e 74  /[v_]/,"");print
14230 66 20 22 25 73 22 2c 20 24 31 20 7d 27 0a 20 20  f "%s", $1 }'.  
14240 20 20 23 0a 20 20 20 20 23 20 20 20 6d 61 78 20    #.    #   max 
14250 33 32 20 63 68 61 72 61 63 74 65 72 73 20 2d 2d  32 characters --
14260 2d 20 66 69 6c 65 20 73 69 7a 65 20 20 20 20 0a  - file size    .
14270 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
14280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 67                rg
14290 78 5f 69 6e 5f 72 75 62 79 3d 2f 73 5b 5c 64 5d  x_in_ruby=/s[\d]
142a0 2b 5b 5f 5d 2f 0a 20 20 20 20 23 20 20 20 20 20  +[_]/.    #     
142b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
142c0 20 20 20 20 65 63 68 6f 20 22 76 30 30 33 34 5f      echo "v0034_
142d0 22 20 7c 20 67 61 77 6b 20 27 2f 5e 76 5b 30 2d  " | gawk '/^v[0-
142e0 39 5d 7b 34 7d 5f 2f 20 7b 70 72 69 6e 74 66 20  9]{4}_/ {printf 
142f0 22 25 73 22 2c 24 31 20 7d 27 0a 20 20 20 20 23  "%s",$1 }'.    #
14300 20 65 63 68 6f 20 22 76 30 30 33 34 5f 73 32 33   echo "v0034_s23
14310 34 32 5f 22 20 7c 20 67 61 77 6b 20 27 7b 20 67  42_" | gawk '{ g
14320 73 75 62 28 2f 5f 2f 2c 20 22 5f 5c 6e 22 29 3b  sub(/_/, "_\n");
14330 20 70 72 69 6e 74 20 7d 27 20 7c 20 5c 0a 20 20   print }' | \.  
14340 20 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20    #             
14350 20 20 20 20 20 20 20 20 20 20 67 61 77 6b 20 27            gawk '
14360 2f 5e 73 5b 30 2d 39 5d 2b 5f 2f 20 7b 70 72 69  /^s[0-9]+_/ {pri
14370 6e 74 66 20 22 25 73 22 2c 24 31 20 7d 27 20 7c  ntf "%s",$1 }' |
14380 20 5c 0a 20 20 20 20 23 20 20 20 20 20 20 20 20   \.    #        
14390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67                 g
143a0 61 77 6b 20 27 7b 67 73 75 62 28 2f 5b 73 5f 5d  awk '{gsub(/[s_]
143b0 2f 2c 22 22 29 3b 70 72 69 6e 74 66 20 22 25 73  /,"");printf "%s
143c0 22 2c 20 24 31 20 7d 27 0a 20 20 20 20 23 0a 20  ", $1 }'.    #. 
143d0 20 20 20 23 0a 20 20 20 20 23 20 20 20 20 20 20     #.    #      
143e0 20 36 36 20 63 68 61 72 61 63 74 65 72 73 20 2d   66 characters -
143f0 2d 2d 20 53 48 41 2d 32 35 36 20 20 0a 20 20 20  -- SHA-256  .   
14400 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20   #              
14410 20 20 20 20 20 20 20 20 20 20 20 72 67 78 5f 69             rgx_i
14420 6e 5f 72 75 62 79 3d 2f 68 5b 5c 64 61 62 63 64  n_ruby=/h[\dabcd
14430 65 66 5d 7b 36 34 7d 5b 5f 5d 2f 0a 20 20 20 20  ef]{64}[_]/.    
14440 23 20 65 63 68 6f 20 22 68 60 73 68 61 32 35 36  # echo "h`sha256
14450 73 75 6d 20 2f 64 65 76 2f 6e 75 6c 6c 20 7c 20  sum /dev/null | 
14460 67 61 77 6b 20 27 2f 5b 30 2d 39 61 62 63 64 65  gawk '/[0-9abcde
14470 66 5d 2f 20 7b 70 72 69 6e 74 66 20 22 25 73 22  f]/ {printf "%s"
14480 2c 24 31 7d 27 60 5f 22 20 7c 20 5c 0a 20 20 20  ,$1}'`_" | \.   
14490 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20   #              
144a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
144b0 20 67 61 77 6b 20 27 2f 5e 68 5b 30 2d 39 61 62   gawk '/^h[0-9ab
144c0 63 64 65 66 5d 2b 5f 2f 20 7b 70 72 69 6e 74 66  cdef]+_/ {printf
144d0 20 22 25 73 22 2c 24 31 20 7d 27 20 7c 20 5c 0a   "%s",$1 }' | \.
144e0 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
144f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14500 20 20 20 20 67 61 77 6b 20 27 7b 67 73 75 62 28      gawk '{gsub(
14510 2f 5b 68 5f 5d 2f 2c 22 22 29 3b 70 72 69 6e 74  /[h_]/,"");print
14520 66 20 22 25 73 22 2c 20 24 31 20 7d 27 0a 20 20  f "%s", $1 }'.  
14530 20 20 23 0a 20 20 20 20 23 0a 20 20 20 20 23 20    #.    #.    # 
14540 20 20 20 20 20 20 35 30 20 63 68 61 72 61 63 74        50 charact
14550 65 72 73 20 2d 2d 2d 20 54 69 67 65 72 0a 20 20  ers --- Tiger.  
14560 20 20 23 20 20 20 20 20 20 20 20 20 20 20 20 20    #             
14570 20 20 20 20 20 20 20 20 20 20 20 20 72 67 78 5f              rgx_
14580 69 6e 5f 72 75 62 79 3d 2f 69 5b 5c 64 61 62 63  in_ruby=/i[\dabc
14590 64 65 66 5d 7b 34 38 7d 24 2f 20 20 20 23 20 6c  def]{48}$/   # l
145a0 61 63 6b 73 20 74 68 65 20 65 6e 64 69 6e 67 20  acks the ending 
145b0 22 5f 22 20 0a 20 20 20 20 23 20 20 20 20 20 20  "_" .    #      
145c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
145d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
145e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
145f0 20 20 20 20 23 20 66 6f 72 20 64 62 20 69 6e 64      # for db ind
14600 65 78 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0a  ex optimization.
14610 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
14620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 68                Th
14630 65 20 67 61 77 6b 20 63 6f 64 65 20 69 73 20 61  e gawk code is a
14640 73 20 77 69 74 68 20 74 68 65 20 73 68 61 32 35  s with the sha25
14650 36 2c 20 0a 20 20 20 20 23 20 20 20 20 20 20 20  6, .    #       
14660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14670 20 20 65 78 63 65 70 74 20 74 68 61 74 20 73 68    except that sh
14680 61 32 35 36 73 75 6d 2d 3e 20 74 69 67 65 72 64  a256sum-> tigerd
14690 65 65 70 2c 20 22 5e 68 22 2d 3e 22 5e 69 22 2c  eep, "^h"->"^i",
146a0 0a 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20  .    #          
146b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22                 "
146c0 5b 68 5f 5d 22 2d 3e 22 5b 69 5f 5d 22 0a 20 20  [h_]"->"[i_]".  
146d0 20 20 23 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d    #.    #-------
146e0 2d 0a 20 20 20 20 23 20 41 73 20 74 68 65 20 63  -.    # As the c
146f0 75 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 20 6f  urrent version o
14700 66 20 74 68 69 73 20 73 63 72 69 70 74 20 64 65  f this script de
14710 70 65 6e 64 73 20 6f 6e 20 52 75 62 79 20 61 6e  pends on Ruby an
14720 79 77 61 79 2c 0a 20 20 20 20 23 20 74 68 65 20  yway,.    # the 
14730 67 61 77 6b 20 72 65 67 65 78 20 62 61 73 65 64  gawk regex based
14740 20 62 72 61 6e 63 68 65 73 20 74 68 61 74 20 61   branches that a
14750 72 65 20 72 65 61 6c 6c 79 0a 20 20 20 20 23 20  re really.    # 
14760 63 6f 6d 70 6c 65 78 20 61 6e 64 20 72 65 71 75  complex and requ
14770 69 72 65 20 6d 75 6c 74 69 70 6c 65 20 67 61 77  ire multiple gaw
14780 6b 20 63 61 6c 6c 73 20 63 61 6e 20 62 65 20 6c  k calls can be l
14790 65 66 74 20 75 6e 69 6d 70 6c 65 6d 65 6e 74 65  eft unimplemente
147a0 64 2e 0a 20 20 20 20 23 20 54 68 61 74 20 77 61  d..    # That wa
147b0 79 20 74 68 69 73 20 73 63 72 69 70 74 20 62 65  y this script be
147c0 63 6f 6d 65 73 20 6d 6f 72 65 20 73 75 63 63 69  comes more succi
147d0 6e 63 74 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  nct..    #------
147e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20  --------------. 
147f0 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 74 69 67     func_mmmv_tig
14800 65 72 68 61 73 68 5f 74 31 20 22 24 53 5f 46 50  erhash_t1 "$S_FP
14810 5f 30 22 0a 20 20 20 20 23 65 63 68 6f 20 22 20  _0".    #echo " 
14820 20 20 20 20 20 20 54 69 67 65 72 3a 20 24 53 5f        Tiger: $S_
14830 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52 48  FUNC_MMMV_TIGERH
14840 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20  ASH_T1_RESULT". 
14850 20 20 20 23 66 75 6e 63 5f 6d 6d 6d 76 5f 77 68     #func_mmmv_wh
14860 69 72 6c 70 6f 6f 6c 68 61 73 68 5f 74 31 20 22  irlpoolhash_t1 "
14870 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 23 65 63  $S_FP_0".    #ec
14880 68 6f 20 22 20 20 20 57 68 69 72 6c 70 6f 6f 6c  ho "   Whirlpool
14890 3a 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57  : $S_FUNC_MMMV_W
148a0 48 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f  HIRLPOOLHASH_T1_
148b0 52 45 53 55 4c 54 22 0a 20 20 20 20 66 75 6e 63  RESULT".    func
148c0 5f 6d 6d 6d 76 5f 73 68 61 32 35 36 5f 74 31 20  _mmmv_sha256_t1 
148d0 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 23 65  "$S_FP_0".    #e
148e0 63 68 6f 20 22 20 20 20 20 20 20 53 48 41 32 35  cho "      SHA25
148f0 36 3a 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  6: $S_FUNC_MMMV_
14900 53 48 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54  SHA256_T1_RESULT
14910 22 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  ".    func_mmmv_
14920 66 69 6c 65 73 69 7a 65 5f 74 31 20 22 24 53 5f  filesize_t1 "$S_
14930 46 50 5f 30 22 0a 20 20 20 20 23 65 63 68 6f 20  FP_0".    #echo 
14940 22 20 20 20 66 69 6c 65 20 73 69 7a 65 3a 20 24  "   file size: $
14950 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45  S_FUNC_MMMV_FILE
14960 53 49 5a 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a  SIZE_T1_RESULT".
14970 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
14980 20 20 6c 6f 63 61 6c 20 53 5f 4e 41 4d 45 5f 52    local S_NAME_R
14990 45 56 45 52 53 45 44 3d 22 62 6f 6c 62 74 73 2e  EVERSED="bolbts.
149a0 22 20 23 20 22 2e 73 74 62 6c 6f 62 22 2e 72 65  " # ".stblob".re
149b0 76 65 72 73 65 0a 20 20 20 20 6c 6f 63 61 6c 20  verse.    local 
149c0 53 5f 30 3d 22 76 30 30 30 31 5f 73 24 53 5f 46  S_0="v0001_s$S_F
149d0 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a  UNC_MMMV_FILESIZ
149e0 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20 20  E_T1_RESULT".   
149f0 20 53 5f 4e 41 4d 45 5f 52 45 56 45 52 53 45 44   S_NAME_REVERSED
14a00 3d 22 24 53 5f 4e 41 4d 45 5f 52 45 56 45 52 53  ="$S_NAME_REVERS
14a10 45 44 24 53 5f 30 22 0a 20 20 20 20 53 5f 30 3d  ED$S_0".    S_0=
14a20 22 5f 68 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f  "_h$S_FUNC_MMMV_
14a30 53 48 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54  SHA256_T1_RESULT
14a40 22 0a 20 20 20 20 53 5f 4e 41 4d 45 5f 52 45 56  ".    S_NAME_REV
14a50 45 52 53 45 44 3d 22 24 53 5f 4e 41 4d 45 5f 52  ERSED="$S_NAME_R
14a60 45 56 45 52 53 45 44 24 53 5f 30 22 0a 20 20 20  EVERSED$S_0".   
14a70 20 53 5f 30 3d 22 5f 69 24 53 5f 46 55 4e 43 5f   S_0="_i$S_FUNC_
14a80 4d 4d 4d 56 5f 54 49 47 45 52 48 41 53 48 5f 54  MMMV_TIGERHASH_T
14a90 31 5f 52 45 53 55 4c 54 22 0a 20 20 20 20 53 5f  1_RESULT".    S_
14aa0 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 3d 22 24  NAME_REVERSED="$
14ab0 53 5f 4e 41 4d 45 5f 52 45 56 45 52 53 45 44 24  S_NAME_REVERSED$
14ac0 53 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20  S_0".    #----. 
14ad0 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53     S_FUNC_MMMV_S
14ae0 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
14af0 47 45 52 5f 54 31 5f 42 41 53 48 5f 52 45 56 45  GER_T1_BASH_REVE
14b00 52 53 45 5f 53 54 52 49 4e 47 5f 52 45 47 49 53  RSE_STRING_REGIS
14b10 54 45 52 3d 22 24 53 5f 4e 41 4d 45 5f 52 45 56  TER="$S_NAME_REV
14b20 45 52 53 45 44 22 0a 20 20 20 20 66 75 6e 63 5f  ERSED".    func_
14b30 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
14b40 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
14b50 68 5f 72 65 76 65 72 73 65 5f 73 74 72 69 6e 67  h_reverse_string
14b60 0a 20 20 20 20 53 5f 30 3d 22 24 53 5f 46 55 4e  .    S_0="$S_FUN
14b70 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45  C_MMMV_SILKTORRE
14b80 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42  NT_PACKAGER_T1_B
14b90 41 53 48 5f 52 45 56 45 52 53 45 5f 53 54 52 49  ASH_REVERSE_STRI
14ba0 4e 47 5f 52 45 47 49 53 54 45 52 22 0a 20 20 20  NG_REGISTER".   
14bb0 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c   S_FUNC_MMMV_SIL
14bc0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
14bd0 52 5f 54 31 5f 42 41 53 48 5f 42 4c 4f 42 32 46  R_T1_BASH_BLOB2F
14be0 49 4c 45 4e 41 4d 45 5f 54 31 5f 52 45 53 55 4c  ILENAME_T1_RESUL
14bf0 54 3d 22 24 53 5f 30 22 0a 7d 20 23 20 66 75 6e  T="$S_0".} # fun
14c00 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65  c_mmmv_silktorre
14c10 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62  nt_packager_t1_b
14c20 61 73 68 5f 62 6c 6f 62 32 66 69 6c 65 6e 61 6d  ash_blob2filenam
14c30 65 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  e_t1...#--------
14c40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
14c80 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 64 65  --..func_mmmv_de
14c90 6c 65 74 65 5f 74 6d 70 5f 66 6f 6c 64 65 72 5f  lete_tmp_folder_
14ca0 74 31 28 29 7b 0a 20 20 20 20 6c 6f 63 61 6c 20  t1(){.    local 
14cb0 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 66 6f  S_FP_0="$1" # fo
14cc0 6c 64 65 72 20 70 61 74 68 0a 20 20 20 20 23 2d  lder path.    #-
14cd0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
14ce0 20 21 20 2d 65 20 22 24 53 5f 46 50 5f 30 22 20   ! -e "$S_FP_0" 
14cf0 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
14d00 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
14d10 65 63 68 6f 20 22 54 68 69 73 20 73 63 72 69 70  echo "This scrip
14d20 74 20 69 73 20 66 6c 61 77 65 64 2e 20 54 68 65  t is flawed. The
14d30 20 66 6f 6c 64 65 72 20 22 0a 20 20 20 20 20 20   folder ".      
14d40 20 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46    echo "    $S_F
14d50 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65 63 68  P_0".        ech
14d60 6f 20 22 69 73 20 65 78 70 65 63 74 65 64 20 74  o "is expected t
14d70 6f 20 65 78 69 73 74 20 64 75 72 69 6e 67 20 74  o exist during t
14d80 68 65 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  he ".        ech
14d90 6f 20 22 63 61 6c 6c 20 74 6f 20 74 68 69 73 20  o "call to this 
14da0 66 75 6e 63 74 69 6f 6e 2e 22 0a 20 20 20 20 20  function.".     
14db0 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
14dc0 37 35 37 34 62 66 33 34 2d 62 30 63 34 2d 34 62  7574bf34-b0c4-4b
14dd0 61 39 2d 61 35 62 64 2d 38 30 32 30 37 30 65 30  a9-a5bd-802070e0
14de0 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
14df0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
14e00 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
14e10 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
14e20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
14e30 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
14e40 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
14e50 0a 20 20 20 20 23 20 54 6f 20 61 76 6f 69 64 20  .    # To avoid 
14e60 61 20 73 69 74 75 61 74 69 6f 6e 2c 20 77 68 65  a situation, whe
14e70 72 65 20 64 75 65 20 74 6f 20 73 6f 6d 65 20 0a  re due to some .
14e80 20 20 20 20 23 20 66 6c 61 77 20 74 68 65 20 68      # flaw the h
14e90 6f 6d 65 20 66 6f 6c 64 65 72 20 6f 72 20 73 6f  ome folder or so
14ea0 6d 65 74 68 69 6e 67 20 65 6c 73 65 20 69 6d 70  mething else imp
14eb0 6f 72 74 61 6e 74 20 0a 20 20 20 20 23 20 67 65  ortant .    # ge
14ec0 74 73 20 61 63 63 69 64 65 6e 74 61 6c 6c 79 20  ts accidentally 
14ed0 72 65 63 75 72 73 69 76 65 6c 79 20 64 65 6c 65  recursively dele
14ee0 74 65 64 2c 20 0a 20 20 20 20 23 20 74 68 65 20  ted, .    # the 
14ef0 66 6f 6c 6c 6f 77 69 6e 67 20 74 65 73 74 20 74  following test t
14f00 72 61 6e 73 66 6f 72 6d 73 20 74 68 65 20 70 61  ransforms the pa
14f10 74 68 20 66 72 6f 6d 20 0a 20 20 20 20 23 20 2f  th from .    # /
14f20 74 6d 70 2f 2e 2e 2f 68 6f 6d 65 2f 62 6c 61 62  tmp/../home/blab
14f30 6c 61 0a 20 20 20 20 23 20 74 6f 20 61 20 66 75  la.    # to a fu
14f40 6c 6c 20 70 61 74 68 20 77 69 74 68 6f 75 74 20  ll path without 
14f50 74 68 65 20 64 6f 74 73 20 61 6e 64 20 74 68 65  the dots and the
14f60 6e 20 73 74 75 64 69 65 73 2c 20 77 68 65 74 68  n studies, wheth
14f70 65 72 0a 20 20 20 20 23 20 74 68 65 20 66 75 6c  er.    # the ful
14f80 6c 20 70 61 74 68 20 70 6f 69 6e 74 73 20 74 6f  l path points to
14f90 20 73 6f 6d 65 77 68 65 72 65 20 69 6e 20 74 68   somewhere in th
14fa0 65 20 2f 74 6d 70 0a 20 20 20 20 6c 6f 63 61 6c  e /tmp.    local
14fb0 20 53 5f 46 50 5f 31 3d 22 60 63 64 20 24 53 5f   S_FP_1="`cd $S_
14fc0 46 50 5f 30 3b 20 70 77 64 60 22 0a 20 20 20 20  FP_0; pwd`".    
14fd0 69 66 20 5b 20 21 20 2d 65 20 22 24 53 5f 46 50  if [ ! -e "$S_FP
14fe0 5f 31 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  _1" ]; then.    
14ff0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
15000 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20 73      echo "This s
15010 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e  cript is flawed.
15020 20 54 68 65 20 66 6f 6c 64 65 72 20 22 0a 20 20   The folder ".  
15030 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20        echo "    
15040 24 53 5f 46 50 5f 31 22 0a 20 20 20 20 20 20 20  $S_FP_1".       
15050 20 65 63 68 6f 20 22 69 73 20 6d 69 73 73 69 6e   echo "is missin
15060 67 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  g.".        echo
15070 20 22 47 55 49 44 3d 3d 27 38 39 66 63 36 63 35   "GUID=='89fc6c5
15080 30 2d 36 61 31 62 2d 34 65 36 38 2d 62 34 62 64  0-6a1b-4e68-b4bd
15090 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
150a0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
150b0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
150c0 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
150d0 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74  RIG.        exit
150e0 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
150f0 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20  rror.    fi.    
15100 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 60  local S_TMP_0="`
15110 65 63 68 6f 20 5c 22 24 53 5f 46 50 5f 31 5c 22  echo \"$S_FP_1\"
15120 20 7c 20 67 72 65 70 20 2d 45 20 5e 2f 68 6f 6d   | grep -E ^/hom
15130 65 20 60 22 0a 20 20 20 20 69 66 20 5b 20 22 24  e `".    if [ "$
15140 53 5f 54 4d 50 5f 30 22 20 21 3d 20 22 22 20 5d  S_TMP_0" != "" ]
15150 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
15160 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
15170 63 68 6f 20 22 54 68 69 73 20 73 63 72 69 70 74  cho "This script
15180 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20   is flawed.".   
15190 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 74       echo "The t
151a0 65 6d 70 6f 72 61 72 79 20 73 61 6e 64 62 6f 78  emporary sandbox
151b0 20 66 6f 6c 64 65 72 20 6d 75 73 74 20 72 65 73   folder must res
151c0 69 64 65 20 69 6e 20 2f 74 6d 70 2e 22 0a 20 20  ide in /tmp.".  
151d0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
151e0 20 20 20 20 20 20 65 63 68 6f 20 22 53 5f 46 50        echo "S_FP
151f0 5f 30 3d 3d 24 53 5f 46 50 5f 30 22 0a 20 20 20  _0==$S_FP_0".   
15200 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
15210 20 20 20 20 20 65 63 68 6f 20 22 53 5f 46 50 5f       echo "S_FP_
15220 31 3d 3d 24 53 5f 46 50 5f 31 22 0a 20 20 20 20  1==$S_FP_1".    
15230 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
15240 20 20 20 20 65 63 68 6f 20 22 53 5f 54 4d 50 5f      echo "S_TMP_
15250 30 3d 3d 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20  0==$S_TMP_0".   
15260 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
15270 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
15280 3d 27 33 33 66 39 65 37 32 31 2d 64 31 34 31 2d  ='33f9e721-d141-
15290 34 61 31 35 2d 39 33 61 64 2d 38 30 32 30 37 30  4a15-93ad-802070
152a0 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
152b0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
152c0 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
152d0 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
152e0 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
152f0 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
15300 20 20 66 69 0a 20 20 20 20 23 20 4a 75 73 74 20    fi.    # Just 
15310 74 6f 20 62 65 20 73 75 72 65 2c 20 74 68 65 20  to be sure, the 
15320 73 61 6d 65 20 74 68 69 6e 67 20 69 73 20 63 68  same thing is ch
15330 65 63 6b 65 64 20 62 79 20 61 20 73 6c 69 67 68  ecked by a sligh
15340 74 6c 79 20 0a 20 20 20 20 23 20 64 69 66 66 65  tly .    # diffe
15350 72 65 6e 74 20 72 65 67 65 78 20 61 6e 64 20 75  rent regex and u
15360 73 69 6e 67 20 74 68 65 20 22 3d 3d 22 20 69 6e  sing the "==" in
15370 20 73 74 65 61 64 20 6f 66 20 74 68 65 20 22 21   stead of the "!
15380 3d 22 2e 0a 20 20 20 20 53 5f 54 4d 50 5f 30 3d  ="..    S_TMP_0=
15390 22 60 65 63 68 6f 20 5c 22 24 53 5f 46 50 5f 31  "`echo \"$S_FP_1
153a0 5c 22 20 7c 20 67 72 65 70 20 2d 45 20 5e 2f 74  \" | grep -E ^/t
153b0 6d 70 2f 60 22 20 0a 20 20 20 20 69 66 20 5b 20  mp/`" .    if [ 
153c0 22 24 53 5f 54 4d 50 5f 30 22 20 3d 3d 20 22 22  "$S_TMP_0" == ""
153d0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
153e0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
153f0 20 65 63 68 6f 20 22 54 68 69 73 20 73 63 72 69   echo "This scri
15400 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20  pt is flawed.". 
15410 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
15420 20 74 65 6d 70 6f 72 61 72 79 20 73 61 6e 64 62   temporary sandb
15430 6f 78 20 66 6f 6c 64 65 72 20 6d 75 73 74 20 72  ox folder must r
15440 65 73 69 64 65 20 69 6e 20 2f 74 6d 70 2e 22 0a  eside in /tmp.".
15450 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
15460 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 5f          echo "S_
15470 46 50 5f 30 3d 3d 24 53 5f 46 50 5f 30 22 0a 20  FP_0==$S_FP_0". 
15480 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
15490 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 5f 46         echo "S_F
154a0 50 5f 31 3d 3d 24 53 5f 46 50 5f 31 22 0a 20 20  P_1==$S_FP_1".  
154b0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
154c0 20 20 20 20 20 20 65 63 68 6f 20 22 53 5f 54 4d        echo "S_TM
154d0 50 5f 30 3d 3d 24 53 5f 54 4d 50 5f 30 22 0a 20  P_0==$S_TMP_0". 
154e0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
154f0 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
15500 44 3d 3d 27 35 33 32 32 65 32 63 35 2d 35 34 30  D=='5322e2c5-540
15510 38 2d 34 35 36 63 2d 39 36 61 64 2d 38 30 32 30  8-456c-96ad-8020
15520 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
15530 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
15540 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
15550 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
15560 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
15570 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
15580 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
15590 2d 2d 2d 2d 0a 20 20 20 20 72 6d 20 2d 66 72 20  ----.    rm -fr 
155a0 24 53 5f 46 50 5f 31 0a 20 20 20 20 69 66 20 5b  $S_FP_1.    if [
155b0 20 2d 65 20 22 24 53 5f 46 50 5f 31 22 20 5d 3b   -e "$S_FP_1" ];
155c0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
155d0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
155e0 68 6f 20 22 53 6f 6d 65 74 68 69 6e 67 20 77 65  ho "Something we
155f0 6e 74 20 77 72 6f 6e 67 2e 20 54 68 65 20 72 65  nt wrong. The re
15600 63 75 72 73 69 76 65 20 64 65 6c 65 74 69 6f 6e  cursive deletion
15610 20 6f 66 20 74 68 65 20 74 65 6d 70 6f 72 61 72   of the temporar
15620 79 20 66 6f 6c 64 65 72 2c 20 22 0a 20 20 20 20  y folder, ".    
15630 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 24 53      echo "    $S
15640 5f 46 50 5f 31 22 0a 20 20 20 20 20 20 20 20 65  _FP_1".        e
15650 63 68 6f 20 22 66 61 69 6c 65 64 2e 22 0a 20 20  cho "failed.".  
15660 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
15670 3d 3d 27 35 33 64 38 35 66 31 33 2d 38 33 64 65  =='53d85f13-83de
15680 2d 34 61 62 32 2d 38 35 61 64 2d 38 30 32 30 37  -4ab2-85ad-80207
15690 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
156a0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
156b0 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
156c0 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
156d0 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
156e0 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
156f0 20 20 20 66 69 0a 7d 20 23 20 66 75 6e 63 5f 6d     fi.} # func_m
15700 6d 6d 76 5f 64 65 6c 65 74 65 5f 74 6d 70 5f 66  mmv_delete_tmp_f
15710 6f 6c 64 65 72 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d  older_t1...#----
15720 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15730 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15740 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15750 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15760 2d 2d 2d 2d 2d 2d 0a 0a 23 20 54 68 72 6f 77 73  ------..# Throws
15770 2c 20 69 66 20 74 68 65 72 65 20 65 78 69 73 74  , if there exist
15780 73 20 61 20 66 69 6c 65 20 77 69 74 68 20 74 68  s a file with th
15790 65 20 73 61 6d 65 20 70 61 74 68 2e 0a 66 75 6e  e same path..fun
157a0 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f 66 6f  c_mmmv_create_fo
157b0 6c 64 65 72 5f 69 66 5f 69 74 5f 64 6f 65 73 5f  lder_if_it_does_
157c0 6e 6f 74 5f 61 6c 72 65 61 64 79 5f 65 78 69 73  not_already_exis
157d0 74 5f 74 31 28 29 7b 0a 20 20 20 20 6c 6f 63 61  t_t1(){.    loca
157e0 6c 20 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20  l S_FP_0="$1" # 
157f0 66 6f 6c 64 65 72 20 70 61 74 68 0a 20 20 20 20  folder path.    
15800 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66  #--------.    if
15810 20 5b 20 22 24 53 5f 46 50 5f 30 22 20 3d 3d 20   [ "$S_FP_0" == 
15820 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
15830 20 20 20 23 20 55 73 69 6e 67 20 67 61 77 6b 20     # Using gawk 
15840 61 6e 64 20 61 6c 69 6b 65 20 74 6f 20 63 6f 76  and alike to cov
15850 65 72 20 61 6c 73 6f 20 63 61 73 65 73 2c 20 77  er also cases, w
15860 68 65 72 65 0a 20 20 20 20 20 20 20 20 23 20 24  here.        # $
15870 53 5f 46 50 5f 30 3d 3d 22 20 20 22 0a 20 20 20  S_FP_0=="  ".   
15880 20 20 20 20 20 23 20 69 73 20 69 6e 74 65 6e 74       # is intent
15890 69 6f 6e 61 6c 6c 79 20 6c 65 66 74 20 6f 75 74  ionally left out
158a0 20 74 6f 20 61 76 6f 69 64 20 74 68 65 20 6f 76   to avoid the ov
158b0 65 72 68 65 61 64 2c 20 62 75 74 0a 20 20 20 20  erhead, but.    
158c0 20 20 20 20 23 20 64 75 65 20 74 6f 20 73 6f 6d      # due to som
158d0 65 20 6c 75 63 6b 20 74 68 65 20 6d 6b 64 69 72  e luck the mkdir
158e0 20 65 78 69 74 73 20 77 69 74 68 20 61 6e 20 65   exits with an e
158f0 72 72 6f 72 20 63 6f 64 65 20 67 72 65 61 74 65  rror code greate
15900 72 20 74 68 61 6e 20 30 2c 0a 20 20 20 20 20 20  r than 0,.      
15910 20 20 23 20 69 66 20 69 74 20 6d 69 73 73 65 73    # if it misses
15920 20 61 20 70 61 74 68 20 61 72 67 75 6d 65 6e 74   a path argument
15930 2e 20 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  . .        echo 
15940 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
15950 22 53 5f 46 50 5f 30 3d 3d 5c 22 5c 22 22 0a 20  "S_FP_0==\"\"". 
15960 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
15970 44 3d 3d 27 37 61 36 61 38 32 32 32 2d 34 36 61  D=='7a6a8222-46a
15980 38 2d 34 66 63 32 2d 61 33 61 64 2d 38 30 32 30  8-4fc2-a3ad-8020
15990 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
159a0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
159b0 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
159c0 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
159d0 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
159e0 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
159f0 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
15a00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15a10 0a 20 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53  .    if [ -e "$S
15a20 5f 46 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20  _FP_0" ]; then. 
15a30 20 20 20 20 20 20 20 69 66 20 5b 20 21 20 2d 64         if [ ! -d
15a40 20 22 24 53 5f 46 50 5f 30 22 20 5d 3b 20 74 68   "$S_FP_0" ]; th
15a50 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
15a60 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
15a70 20 20 20 65 63 68 6f 20 22 54 68 65 20 70 61 74     echo "The pat
15a80 68 20 74 68 61 74 20 69 73 20 73 75 70 70 6f 73  h that is suppos
15a90 65 20 74 6f 20 72 65 66 65 72 65 6e 63 65 20 65  e to reference e
15aa0 69 74 68 65 72 20 22 0a 20 20 20 20 20 20 20 20  ither ".        
15ab0 20 20 20 20 65 63 68 6f 20 22 61 6e 20 65 78 69      echo "an exi
15ac0 73 74 69 6e 67 20 66 6f 6c 64 65 72 20 6f 72 20  sting folder or 
15ad0 61 20 6e 6f 6e 2d 65 78 69 73 74 65 6e 74 20 66  a non-existent f
15ae0 6f 6c 64 65 72 2c 20 22 0a 20 20 20 20 20 20 20  older, ".       
15af0 20 20 20 20 20 65 63 68 6f 20 22 72 65 66 65 72       echo "refer
15b00 65 6e 63 65 73 20 61 20 66 69 6c 65 2e 22 0a 20  ences a file.". 
15b10 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
15b20 22 47 55 49 44 3d 3d 27 35 36 38 64 65 65 39 35  "GUID=='568dee95
15b30 2d 39 34 65 66 2d 34 35 30 38 2d 62 35 61 64 2d  -94ef-4508-b5ad-
15b40 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
15b50 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
15b60 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 23  "".            #
15b70 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20  ----.           
15b80 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
15b90 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74 20             exit 
15ba0 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
15bb0 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a 20  ror.        fi. 
15bc0 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
15bd0 2d 2d 2d 0a 20 20 20 20 6d 6b 64 69 72 20 2d 70  ---.    mkdir -p
15be0 20 24 53 5f 46 50 5f 30 0a 20 20 20 20 69 66 20   $S_FP_0.    if 
15bf0 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b  [ "$?" != "0" ];
15c00 20 74 68 65 6e 20 0a 20 20 20 20 20 20 20 20 65   then .        e
15c10 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
15c20 63 68 6f 20 22 6d 6b 64 69 72 20 66 6f 72 20 70  cho "mkdir for p
15c30 61 74 68 20 22 0a 20 20 20 20 20 20 20 20 65 63  ath ".        ec
15c40 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 30 22  ho "    $S_FP_0"
15c50 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 66  .        echo "f
15c60 61 69 6c 65 64 2e 22 0a 20 20 20 20 20 20 20 20  ailed.".        
15c70 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 34 37 64  echo "GUID=='47d
15c80 62 61 66 34 39 2d 38 31 35 31 2d 34 36 37 64 2d  baf49-8151-467d-
15c90 39 33 39 64 2d 38 30 32 30 37 30 65 30 33 31 65  939d-802070e031e
15ca0 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
15cb0 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
15cc0 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
15cd0 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
15ce0 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
15cf0 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
15d00 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66      #----.    if
15d10 20 5b 20 21 20 2d 65 20 22 24 53 5f 46 50 5f 30   [ ! -e "$S_FP_0
15d20 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
15d30 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
15d40 20 20 65 63 68 6f 20 22 6d 6b 64 69 72 20 65 78    echo "mkdir ex
15d50 65 63 75 74 69 6f 6e 20 73 75 63 63 65 65 64 65  ecution succeede
15d60 64 2c 20 62 75 74 20 66 6f 72 20 73 6f 6d 65 20  d, but for some 
15d70 6f 74 68 65 72 20 72 65 61 73 6f 6e 20 74 68 65  other reason the
15d80 20 66 6f 6c 64 65 72 20 22 0a 20 20 20 20 20 20   folder ".      
15d90 20 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46    echo "    $S_F
15da0 50 5f 30 22 0a 20 20 20 20 20 20 20 20 65 63 68  P_0".        ech
15db0 6f 20 22 64 6f 65 73 20 6e 6f 74 20 65 78 69 73  o "does not exis
15dc0 74 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  t.".        echo
15dd0 20 22 47 55 49 44 3d 3d 27 38 37 34 31 35 64 31   "GUID=='87415d1
15de0 62 2d 65 32 62 35 2d 34 66 30 65 2d 38 32 39 64  b-e2b5-4f0e-829d
15df0 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
15e00 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
15e10 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
15e20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f        cd $S_FP_O
15e30 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74  RIG.        exit
15e40 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
15e50 72 72 6f 72 0a 20 20 20 20 66 69 0a 7d 20 23 20  rror.    fi.} # 
15e60 66 75 6e 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65  func_mmmv_create
15e70 5f 66 6f 6c 64 65 72 5f 69 66 5f 69 74 5f 64 6f  _folder_if_it_do
15e80 65 73 5f 6e 6f 74 5f 61 6c 72 65 61 64 79 5f 65  es_not_already_e
15e90 78 69 73 74 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d  xist_t1...#-----
15ea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15eb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15ec0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15ed0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
15ee0 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55 4e 43 5f 46 55  -----..S_FUNC_FU
15ef0 4e 43 5f 4d 4d 4d 56 5f 43 52 45 41 54 45 5f 54  NC_MMMV_CREATE_T
15f00 4d 50 5f 46 4f 4c 44 45 52 5f 54 31 5f 52 45 53  MP_FOLDER_T1_RES
15f10 55 4c 54 3d 22 22 20 23 20 3d 3d 20 22 22 20 6f  ULT="" # == "" o
15f20 6e 20 66 61 69 6c 75 72 65 0a 20 20 20 20 20 20  n failure.      
15f30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
15f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
15f50 20 20 20 20 20 20 20 20 20 20 23 20 6f 74 68 65            # othe
15f60 72 77 69 73 65 20 66 75 6c 6c 20 66 69 6c 65 20  rwise full file 
15f70 70 61 74 68 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 63  path.func_mmmv_c
15f80 72 65 61 74 65 5f 74 6d 70 5f 66 6f 6c 64 65 72  reate_tmp_folder
15f90 5f 74 31 28 29 7b 0a 20 20 20 20 23 20 44 6f 65  _t1(){.    # Doe
15fa0 73 20 6e 6f 74 20 74 61 6b 65 20 61 6e 79 20 61  s not take any a
15fb0 72 67 75 6d 65 6e 74 73 2e 0a 20 20 20 20 23 2d  rguments..    #-
15fc0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 66 75 6e  -------.    #fun
15fd0 63 5f 6d 6d 6d 76 5f 65 78 63 5f 68 61 73 68 5f  c_mmmv_exc_hash_
15fe0 66 75 6e 63 74 69 6f 6e 5f 69 6e 70 75 74 5f 76  function_input_v
15ff0 65 72 69 66 69 63 61 74 69 6f 6e 5f 74 31 20 22  erification_t1 "
16000 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74  func_mmmv_GUID_t
16010 31 22 20 22 24 31 22 0a 20 20 20 20 23 2d 2d 2d  1" "$1".    #---
16020 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16030 2d 0a 20 20 20 20 53 5f 46 55 4e 43 5f 46 55 4e  -.    S_FUNC_FUN
16040 43 5f 4d 4d 4d 56 5f 43 52 45 41 54 45 5f 54 4d  C_MMMV_CREATE_TM
16050 50 5f 46 4f 4c 44 45 52 5f 54 31 5f 52 45 53 55  P_FOLDER_T1_RESU
16060 4c 54 3d 22 22 20 23 20 76 61 6c 75 65 20 66 6f  LT="" # value fo
16070 72 20 66 61 69 6c 75 72 65 0a 20 20 20 20 66 75  r failure.    fu
16080 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a  nc_mmmv_GUID_t1.
16090 20 20 20 20 69 66 20 5b 20 22 24 53 5f 46 55 4e      if [ "$S_FUN
160a0 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52  C_MMMV_GUID_T1_R
160b0 45 53 55 4c 54 22 20 3d 3d 20 22 22 20 5d 3b 20  ESULT" == "" ]; 
160c0 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
160d0 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
160e0 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69  o "This script i
160f0 73 20 66 6c 61 77 65 64 2e 20 47 55 49 44 20 67  s flawed. GUID g
16100 65 6e 65 72 61 74 69 6f 6e 20 66 61 69 6c 65 64  eneration failed
16110 20 61 6e 64 20 22 0a 20 20 20 20 20 20 20 20 65   and ".        e
16120 63 68 6f 20 22 74 68 65 20 47 55 49 44 20 67 65  cho "the GUID ge
16130 6e 65 72 61 74 69 6f 6e 20 66 75 6e 63 74 69 6f  neration functio
16140 6e 20 64 69 64 20 6e 6f 74 20 74 68 72 6f 77 20  n did not throw 
16150 64 65 73 70 69 74 65 20 22 0a 20 20 20 20 20 20  despite ".      
16160 20 20 65 63 68 6f 20 22 74 68 65 20 66 61 63 74    echo "the fact
16170 20 74 68 61 74 20 69 74 20 73 68 6f 75 6c 64 20   that it should 
16180 68 61 76 65 20 64 65 74 65 63 74 65 64 20 69 74  have detected it
16190 73 20 6f 77 6e 20 66 61 69 6c 75 72 65 2e 22 0a  s own failure.".
161a0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
161b0 49 44 3d 3d 27 35 39 34 66 66 33 62 33 2d 31 30  ID=='594ff3b3-10
161c0 62 64 2d 34 32 64 62 2d 62 31 39 64 2d 38 30 32  bd-42db-b19d-802
161d0 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
161e0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
161f0 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
16200 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
16210 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
16220 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
16230 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
16240 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d  -.    local S_TM
16250 50 5f 30 3d 22 2f 74 6d 70 2f 74 6d 70 5f 73 69  P_0="/tmp/tmp_si
16260 6c 6b 74 6f 72 72 65 6e 74 5f 24 53 5f 46 55 4e  lktorrent_$S_FUN
16270 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52  C_MMMV_GUID_T1_R
16280 45 53 55 4c 54 22 0a 20 20 20 20 23 20 54 68 65  ESULT".    # The
16290 20 66 6f 6c 6c 6f 77 69 6e 67 20 66 65 77 20 69   following few i
162a0 66 2d 63 6c 61 75 73 65 73 20 66 6f 72 6d 20 61  f-clauses form a
162b0 20 73 68 6f 72 74 20 75 6e 72 6f 6c 6c 65 64 20   short unrolled 
162c0 6c 6f 6f 70 2e 20 54 68 65 20 75 6e 72 6f 6c 6c  loop. The unroll
162d0 69 6e 67 20 0a 20 20 20 20 23 20 69 73 20 66 6f  ing .    # is fo
162e0 72 20 73 69 6d 70 6c 69 63 69 74 79 2c 20 62 65  r simplicity, be
162f0 63 61 75 73 65 20 69 74 20 69 73 20 42 61 73 68  cause it is Bash
16300 2c 20 77 68 65 72 65 20 6c 6f 6f 70 73 20 61 72  , where loops ar
16310 65 20 6e 61 73 74 79 2e 0a 20 20 20 20 69 66 20  e nasty..    if 
16320 5b 20 2d 65 20 22 24 53 5f 54 4d 50 5f 30 22 20  [ -e "$S_TMP_0" 
16330 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
16340 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74  func_mmmv_GUID_t
16350 31 0a 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f  1.        S_TMP_
16360 30 3d 22 2f 74 6d 70 2f 74 6d 70 5f 73 69 6c 6b  0="/tmp/tmp_silk
16370 74 6f 72 72 65 6e 74 5f 24 53 5f 46 55 4e 43 5f  torrent_$S_FUNC_
16380 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53  MMMV_GUID_T1_RES
16390 55 4c 54 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ULT".    fi.    
163a0 69 66 20 5b 20 2d 65 20 22 24 53 5f 54 4d 50 5f  if [ -e "$S_TMP_
163b0 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  0" ]; then.     
163c0 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49     func_mmmv_GUI
163d0 44 5f 74 31 0a 20 20 20 20 20 20 20 20 53 5f 54  D_t1.        S_T
163e0 4d 50 5f 30 3d 22 2f 74 6d 70 2f 74 6d 70 5f 73  MP_0="/tmp/tmp_s
163f0 69 6c 6b 74 6f 72 72 65 6e 74 5f 24 53 5f 46 55  ilktorrent_$S_FU
16400 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f  NC_MMMV_GUID_T1_
16410 52 45 53 55 4c 54 22 0a 20 20 20 20 66 69 0a 20  RESULT".    fi. 
16420 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53 5f 54     if [ -e "$S_T
16430 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
16440 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f        func_mmmv_
16450 47 55 49 44 5f 74 31 0a 20 20 20 20 20 20 20 20  GUID_t1.        
16460 53 5f 54 4d 50 5f 30 3d 22 2f 74 6d 70 2f 74 6d  S_TMP_0="/tmp/tm
16470 70 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 24 53  p_silktorrent_$S
16480 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f  _FUNC_MMMV_GUID_
16490 54 31 5f 52 45 53 55 4c 54 22 0a 20 20 20 20 66  T1_RESULT".    f
164a0 69 0a 20 20 20 20 69 66 20 5b 20 2d 65 20 22 24  i.    if [ -e "$
164b0 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e  S_TMP_0" ]; then
164c0 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d  .        func_mm
164d0 6d 76 5f 47 55 49 44 5f 74 31 0a 20 20 20 20 20  mv_GUID_t1.     
164e0 20 20 20 53 5f 54 4d 50 5f 30 3d 22 2f 74 6d 70     S_TMP_0="/tmp
164f0 2f 74 6d 70 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  /tmp_silktorrent
16500 5f 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55  _$S_FUNC_MMMV_GU
16510 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20  ID_T1_RESULT".  
16520 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20    fi.    #----. 
16530 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53 5f 54     if [ -e "$S_T
16540 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
16550 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
16560 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73        echo "This
16570 20 73 63 72 69 70 74 20 66 61 69 6c 65 64 20 74   script failed t
16580 6f 20 67 65 6e 65 72 61 74 65 20 61 20 6c 6f 63  o generate a loc
16590 61 6c 6c 79 20 75 6e 69 71 75 65 20 70 61 74 68  ally unique path
165a0 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  .".        echo 
165b0 22 47 55 49 44 3d 3d 27 35 39 64 39 31 38 31 32  "GUID=='59d91812
165c0 2d 34 61 62 37 2d 34 63 32 61 2d 38 37 39 64 2d  -4ab7-4c2a-879d-
165d0 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a 20  802070e031e7'". 
165e0 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
165f0 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20         #----.   
16600 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52       cd $S_FP_OR
16610 49 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20  IG.        exit 
16620 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65 72  1 # exit with er
16630 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20 20 66  ror.    fi.    f
16640 75 6e 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f  unc_mmmv_create_
16650 66 6f 6c 64 65 72 5f 69 66 5f 69 74 5f 64 6f 65  folder_if_it_doe
16660 73 5f 6e 6f 74 5f 61 6c 72 65 61 64 79 5f 65 78  s_not_already_ex
16670 69 73 74 5f 74 31 20 22 24 53 5f 54 4d 50 5f 30  ist_t1 "$S_TMP_0
16680 22 0a 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20  ".    if [ ! -e 
16690 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68  "$S_TMP_0" ]; th
166a0 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  en.        echo 
166b0 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
166c0 22 6d 6b 64 69 72 20 66 6f 72 20 70 61 74 68 20  "mkdir for path 
166d0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
166e0 20 20 20 20 24 53 5f 54 4d 50 5f 30 22 0a 20 20      $S_TMP_0".  
166f0 20 20 20 20 20 20 65 63 68 6f 20 22 66 61 69 6c        echo "fail
16700 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  ed.".        ech
16710 6f 20 22 47 55 49 44 3d 3d 27 35 63 38 65 33 64  o "GUID=='5c8e3d
16720 30 31 2d 63 37 30 33 2d 34 65 61 30 2d 61 32 38  01-c703-4ea0-a28
16730 64 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22  d-802070e031e7'"
16740 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
16750 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
16760 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
16770 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78 69  ORIG.        exi
16780 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
16790 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20 20  error.    fi.   
167a0 20 53 5f 46 55 4e 43 5f 46 55 4e 43 5f 4d 4d 4d   S_FUNC_FUNC_MMM
167b0 56 5f 43 52 45 41 54 45 5f 54 4d 50 5f 46 4f 4c  V_CREATE_TMP_FOL
167c0 44 45 52 5f 54 31 5f 52 45 53 55 4c 54 3d 22 24  DER_T1_RESULT="$
167d0 53 5f 54 4d 50 5f 30 22 0a 7d 20 23 20 66 75 6e  S_TMP_0".} # fun
167e0 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f 74 6d  c_mmmv_create_tm
167f0 70 5f 66 6f 6c 64 65 72 5f 74 31 20 0a 0a 0a 23  p_folder_t1 ...#
16800 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16820 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16840 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 5f 46 55  ----------..S_FU
16850 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52  NC_MMMV_SILKTORR
16860 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
16870 42 41 53 48 5f 47 45 54 5f 50 41 43 4b 45 54 5f  BASH_GET_PACKET_
16880 46 4f 52 4d 41 54 5f 56 45 52 53 49 4f 4e 5f 54  FORMAT_VERSION_T
16890 31 5f 52 45 53 55 4c 54 3d 22 6e 6f 74 20 73 65  1_RESULT="not se
168a0 74 22 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c  t".func_mmmv_sil
168b0 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
168c0 72 5f 74 31 5f 62 61 73 68 5f 67 65 74 5f 70 61  r_t1_bash_get_pa
168d0 63 6b 65 74 5f 66 6f 72 6d 61 74 5f 76 65 72 73  cket_format_vers
168e0 69 6f 6e 5f 74 31 28 29 20 7b 20 0a 20 20 20 20  ion_t1() { .    
168f0 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d 22 24 31  local S_FP_0="$1
16900 22 20 23 20 50 61 74 68 20 74 6f 20 74 68 65 20  " # Path to the 
16910 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d 2d 2d 2d  file. .    #----
16920 0a 20 20 20 20 23 20 49 74 27 73 20 6e 6f 74 20  .    # It's not 
16930 6e 65 63 65 73 73 61 72 79 20 66 6f 72 20 74 68  necessary for th
16940 65 20 66 69 6c 65 20 74 6f 20 61 63 74 75 61 6c  e file to actual
16950 6c 79 20 65 78 69 73 74 2c 0a 20 20 20 20 23 20  ly exist,.    # 
16960 62 65 63 61 75 73 65 20 74 68 69 73 20 66 75 6e  because this fun
16970 63 74 69 6f 6e 20 6f 6e 6c 79 20 61 6e 61 6c 79  ction only analy
16980 7a 65 73 20 74 68 65 20 66 69 6c 65 20 70 61 74  zes the file pat
16990 68 20 73 74 72 69 6e 67 2e 0a 20 20 20 20 23 20  h string..    # 
169a0 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
169b0 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
169c0 31 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72  1_bash_exc_asser
169d0 74 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65  t_wrappable_file
169e0 5f 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f 46  _exists_t1 "$S_F
169f0 50 5f 30 22 0a 20 20 20 20 69 66 20 5b 20 22 24  P_0".    if [ "$
16a00 53 5f 46 50 5f 30 22 20 3d 3d 20 22 22 20 5d 3b  S_FP_0" == "" ];
16a10 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
16a20 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
16a30 68 6f 20 22 54 68 65 20 66 69 6c 65 20 70 61 74  ho "The file pat
16a40 68 20 63 61 6e 64 69 64 61 74 65 20 6d 75 73 74  h candidate must
16a50 20 6e 6f 74 20 62 65 20 61 6e 20 65 6d 70 74 79   not be an empty
16a60 20 73 74 72 69 6e 67 2e 22 0a 20 20 20 20 20 20   string.".      
16a70 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 65    echo "GUID=='e
16a80 66 39 33 33 62 32 62 2d 61 35 30 65 2d 34 39 35  f933b2b-a50e-495
16a90 37 2d 38 31 38 64 2d 38 30 32 30 37 30 65 30 33  7-818d-802070e03
16aa0 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
16ab0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
16ac0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
16ad0 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
16ae0 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
16af0 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
16b00 69 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20  i .    #----.   
16b10 20 23 20 54 68 65 20 0a 20 20 20 20 23 0a 20 20   # The .    #.  
16b20 20 20 23 20 20 20 20 20 62 61 73 65 6e 61 6d 65    #     basename
16b30 20 2f 74 6d 70 2f 66 6f 6f 2f 0a 20 20 20 20 23   /tmp/foo/.    #
16b40 0a 20 20 20 20 23 20 72 65 74 75 72 6e 73 0a 20  .    # returns. 
16b50 20 20 20 23 0a 20 20 20 20 23 20 20 20 20 20 66     #.    #     f
16b60 6f 6f 0a 20 20 20 20 23 0a 20 20 20 20 23 20 54  oo.    #.    # T
16b70 68 61 74 20 69 73 20 74 6f 20 73 61 79 2c 20 74  hat is to say, t
16b80 68 65 20 22 62 61 73 65 6e 61 6d 65 22 20 69 67  he "basename" ig
16b90 6e 6f 72 65 73 20 74 68 65 20 72 69 67 68 74 6d  nores the rightm
16ba0 6f 73 74 20 73 6c 61 73 68 2e 0a 20 20 20 20 23  ost slash..    #
16bb0 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ----.    local S
16bc0 5f 54 4d 50 5f 30 3d 22 60 72 75 62 79 20 2d 65  _TMP_0="`ruby -e
16bd0 20 5c 22 5c 0a 20 20 20 20 20 20 20 20 73 3d 27   \"\.        s='
16be0 6e 6f 73 6c 61 73 68 27 3b 5c 0a 20 20 20 20 20  noslash';\.     
16bf0 20 20 20 69 66 28 28 27 24 53 5f 46 50 5f 30 27     if(('$S_FP_0'
16c00 2e 72 65 76 65 72 73 65 29 5b 30 2e 2e 30 5d 3d  .reverse)[0..0]=
16c10 3d 27 2f 27 29 20 74 68 65 6e 20 5c 0a 20 20 20  ='/') then \.   
16c20 20 20 20 20 20 20 20 20 20 73 3d 27 73 6c 61 73           s='slas
16c30 68 5f 70 72 65 73 65 6e 74 27 3b 5c 0a 20 20 20  h_present';\.   
16c40 20 20 20 20 20 65 6e 64 3b 5c 0a 20 20 20 20 20       end;\.     
16c50 20 20 20 70 75 74 73 28 73 29 3b 5c 0a 20 20 20     puts(s);\.   
16c60 20 20 20 20 20 5c 22 60 22 0a 20 20 20 20 69 66       \"`".    if
16c70 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20 21 3d   [ "$S_TMP_0" !=
16c80 20 22 6e 6f 73 6c 61 73 68 22 20 5d 3b 20 74 68   "noslash" ]; th
16c90 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  en.        echo 
16ca0 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
16cb0 22 54 68 65 20 70 61 74 68 20 63 61 6e 64 69 64  "The path candid
16cc0 61 74 65 20 6d 75 73 74 20 6e 6f 74 20 65 6e 64  ate must not end
16cd0 20 77 69 74 68 20 61 20 73 6c 61 73 68 2e 22 0a   with a slash.".
16ce0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
16cf0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
16d00 20 20 53 5f 46 50 5f 30 3d 3d 24 53 5f 46 50 5f    S_FP_0==$S_FP_
16d10 30 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  0".        echo 
16d20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
16d30 22 20 20 20 20 53 5f 54 4d 50 5f 30 3d 3d 24 53  "    S_TMP_0==$S
16d40 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
16d50 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
16d60 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 36 61 35  echo "GUID=='6a5
16d70 64 63 33 35 34 2d 34 32 39 33 2d 34 63 39 66 2d  dc354-4293-4c9f-
16d80 62 32 38 64 2d 38 30 32 30 37 30 65 30 33 31 65  b28d-802070e031e
16d90 37 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  7'".        echo
16da0 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d   "".        #---
16db0 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
16dc0 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
16dd0 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
16de0 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  th error.    fi.
16df0 20 20 20 20 62 61 73 65 6e 61 6d 65 20 24 53 5f      basename $S_
16e00 46 50 5f 30 20 31 3e 2f 64 65 76 2f 6e 75 6c 6c  FP_0 1>/dev/null
16e10 20 23 20 74 6f 20 73 65 74 20 61 20 76 61 6c 75   # to set a valu
16e20 65 20 74 6f 20 74 68 65 20 24 3f 20 69 6e 20 74  e to the $? in t
16e30 68 69 73 20 73 63 6f 70 65 20 0a 20 20 20 20 69  his scope .    i
16e40 66 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20  f [ "$?" != "0" 
16e50 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
16e60 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
16e70 65 63 68 6f 20 22 54 68 65 20 63 6f 6d 6d 61 6e  echo "The comman
16e80 64 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  d ".        echo
16e90 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
16ea0 20 22 20 20 20 20 62 61 73 65 6e 61 6d 65 20 24   "    basename $
16eb0 53 5f 46 50 5f 30 20 22 0a 20 20 20 20 20 20 20  S_FP_0 ".       
16ec0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
16ed0 20 65 63 68 6f 20 22 65 78 69 74 65 64 20 77 69   echo "exited wi
16ee0 74 68 20 61 6e 20 65 72 72 6f 72 2e 22 0a 20 20  th an error.".  
16ef0 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
16f00 3d 3d 27 65 63 36 63 31 37 35 63 2d 62 61 62 30  =='ec6c175c-bab0
16f10 2d 34 30 38 61 2d 62 33 38 64 2d 38 30 32 30 37  -408a-b38d-80207
16f20 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
16f30 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
16f40 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
16f50 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
16f60 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
16f70 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
16f80 20 20 20 66 69 20 0a 20 20 20 20 53 5f 54 4d 50     fi .    S_TMP
16f90 5f 30 3d 22 60 62 61 73 65 6e 61 6d 65 20 24 53  _0="`basename $S
16fa0 5f 46 50 5f 30 60 22 0a 20 20 20 20 69 66 20 5b  _FP_0`".    if [
16fb0 20 22 24 53 5f 54 4d 50 5f 30 22 20 3d 3d 20 22   "$S_TMP_0" == "
16fc0 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
16fd0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
16fe0 20 20 65 63 68 6f 20 22 54 68 65 20 66 69 6c 65    echo "The file
16ff0 20 70 61 74 68 20 63 61 6e 64 69 64 61 74 65 20   path candidate 
17000 6d 75 73 74 20 62 65 20 61 20 73 74 72 69 6e 67  must be a string
17010 20 74 68 61 74 20 22 0a 20 20 20 20 20 20 20 20   that ".        
17020 65 63 68 6f 20 22 69 73 20 6e 6f 74 20 61 6e 20  echo "is not an 
17030 65 6d 70 74 79 20 73 74 72 69 6e 67 20 61 66 74  empty string aft
17040 65 72 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  er ".        ech
17050 6f 20 22 61 6c 6c 20 6f 66 20 74 68 65 20 73 70  o "all of the sp
17060 61 63 65 73 20 61 6e 64 20 74 61 62 73 20 68 61  aces and tabs ha
17070 76 65 20 62 65 65 6e 20 72 65 6d 6f 76 65 64 20  ve been removed 
17080 66 72 6f 6d 20 69 74 2e 22 0a 20 20 20 20 20 20  from it.".      
17090 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 31    echo "GUID=='1
170a0 62 34 30 32 61 65 32 2d 30 39 64 64 2d 34 35 66  b402ae2-09dd-45f
170b0 63 2d 62 32 38 64 2d 38 30 32 30 37 30 65 30 33  c-b28d-802070e03
170c0 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
170d0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
170e0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
170f0 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
17100 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
17110 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
17120 69 20 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  i .    #--------
17130 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56  .    S_FUNC_MMMV
17140 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
17150 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 47 45  KAGER_T1_BASH_GE
17160 54 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 5f  T_PACKET_FORMAT_
17170 56 45 52 53 49 4f 4e 5f 54 31 5f 52 45 53 55 4c  VERSION_T1_RESUL
17180 54 3d 22 22 0a 20 20 20 20 6c 6f 63 61 6c 20 53  T="".    local S
17190 5f 4f 55 54 3d 22 75 6e 73 75 70 70 6f 72 74 65  _OUT="unsupporte
171a0 64 5f 62 79 5f 74 68 69 73 5f 73 63 72 69 70 74  d_by_this_script
171b0 5f 76 65 72 73 69 6f 6e 22 0a 20 20 20 20 23 2d  _version".    #-
171c0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 49 6e  -------.    # In
171d0 20 52 75 62 79 0a 20 20 20 20 23 20 20 20 20 20   Ruby.    #     
171e0 22 66 6f 6f 2e 73 74 62 6c 6f 62 22 5b 30 2e 2e  "foo.stblob"[0..
171f0 28 2d 38 29 5d 3d 3d 22 66 6f 6f 22 0a 20 20 20  (-8)]=="foo".   
17200 20 23 20 20 20 20 20 22 66 6f 6f 2e 73 74 62 6c   #     "foo.stbl
17210 6f 62 22 5b 28 2d 39 39 29 2e 2e 28 2d 31 29 5d  ob"[(-99)..(-1)]
17220 3d 3d 6e 69 6c 0a 20 20 20 20 23 20 0a 20 20 20  ==nil.    # .   
17230 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22   local S_TMP_1="
17240 60 72 75 62 79 20 2d 65 20 5c 22 5c 0a 20 20 20  `ruby -e \"\.   
17250 20 20 20 20 20 78 3d 27 24 53 5f 54 4d 50 5f 30       x='$S_TMP_0
17260 27 5b 30 2e 2e 28 2d 38 29 5d 3b 5c 0a 20 20 20  '[0..(-8)];\.   
17270 20 20 20 20 20 69 66 28 78 21 3d 6e 69 6c 29 20       if(x!=nil) 
17280 74 68 65 6e 5c 0a 20 20 20 20 20 20 20 20 20 20  then\.          
17290 20 20 6d 64 3d 78 2e 72 65 76 65 72 73 65 2e 6d    md=x.reverse.m
172a0 61 74 63 68 28 2f 76 5b 5c 5c 64 5d 2b 2f 29 3b  atch(/v[\\d]+/);
172b0 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66  \.            if
172c0 28 6d 64 21 3d 6e 69 6c 29 20 74 68 65 6e 5c 0a  (md!=nil) then\.
172d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
172e0 73 5f 30 3d 28 6d 64 5b 30 5d 2e 74 6f 5f 73 29  s_0=(md[0].to_s)
172f0 5b 31 2e 2e 28 2d 31 29 5d 3b 5c 0a 20 20 20 20  [1..(-1)];\.    
17300 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 6e              prin
17310 74 28 73 5f 30 2e 73 75 62 28 2f 5e 5b 30 5d 2b  t(s_0.sub(/^[0]+
17320 2f 2c 27 27 29 29 3b 5c 0a 20 20 20 20 20 20 20  /,''));\.       
17330 20 20 20 20 20 65 6e 64 3b 5c 0a 20 20 20 20 20       end;\.     
17340 20 20 20 65 6e 64 3b 5c 0a 20 20 20 20 20 20 20     end;\.       
17350 20 5c 22 60 22 0a 20 20 20 20 23 20 65 63 68 6f   \"`".    # echo
17360 20 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20   "$S_TMP_0".    
17370 23 20 65 63 68 6f 20 22 24 53 5f 54 4d 50 5f 31  # echo "$S_TMP_1
17380 22 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  ".    #----.    
17390 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20  if [ "$S_TMP_1" 
173a0 21 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20  != "" ]; then.  
173b0 20 20 20 20 20 20 53 5f 4f 55 54 3d 22 73 69 6c        S_OUT="sil
173c0 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74 5f  ktorrent_packet_
173d0 66 6f 72 6d 61 74 5f 76 65 72 73 69 6f 6e 5f 24  format_version_$
173e0 53 5f 54 4d 50 5f 31 22 0a 20 20 20 20 66 69 20  S_TMP_1".    fi 
173f0 0a 20 20 20 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56  .    S_FUNC_MMMV
17400 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
17410 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f 47 45  KAGER_T1_BASH_GE
17420 54 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 5f  T_PACKET_FORMAT_
17430 56 45 52 53 49 4f 4e 5f 54 31 5f 52 45 53 55 4c  VERSION_T1_RESUL
17440 54 3d 22 24 53 5f 4f 55 54 22 0a 7d 20 23 20 66  T="$S_OUT".} # f
17450 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
17460 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
17470 5f 62 61 73 68 5f 67 65 74 5f 70 61 63 6b 65 74  _bash_get_packet
17480 5f 66 6f 72 6d 61 74 5f 76 65 72 73 69 6f 6e 5f  _format_version_
17490 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  t1...#----------
174a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
174b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
174c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
174d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
174e0 0a 0a 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49  ..S_FUNC_MMMV_SI
174f0 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
17500 45 52 5f 54 31 5f 42 41 53 48 5f 56 45 52 49 46  ER_T1_BASH_VERIF
17510 59 5f 46 49 4c 45 5f 4e 41 4d 45 5f 54 31 5f 52  Y_FILE_NAME_T1_R
17520 45 53 55 4c 54 3d 22 6e 6f 74 20 73 65 74 22 0a  ESULT="not set".
17530 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
17540 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
17550 31 5f 62 61 73 68 5f 76 65 72 69 66 79 5f 66 69  1_bash_verify_fi
17560 6c 65 5f 6e 61 6d 65 5f 74 31 28 29 20 7b 20 0a  le_name_t1() { .
17570 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30      local S_FP_0
17580 3d 22 24 31 22 20 23 20 50 61 74 68 20 74 6f 20  ="$1" # Path to 
17590 74 68 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23  the file. .    #
175a0 2d 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d  ----.    func_mm
175b0 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
175c0 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
175d0 65 78 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70  exc_assert_wrapp
175e0 61 62 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73  able_file_exists
175f0 5f 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20  _t1 "$S_FP_0".  
17600 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
17610 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
17620 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
17630 31 5f 62 61 73 68 5f 67 65 74 5f 70 61 63 6b 65  1_bash_get_packe
17640 74 5f 66 6f 72 6d 61 74 5f 76 65 72 73 69 6f 6e  t_format_version
17650 5f 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20  _t1 "$S_FP_0".  
17660 20 20 6c 6f 63 61 6c 20 53 5f 50 41 43 4b 45 54    local S_PACKET
17670 5f 46 4f 52 4d 41 54 3d 22 24 53 5f 46 55 4e 43  _FORMAT="$S_FUNC
17680 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e  _MMMV_SILKTORREN
17690 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41  T_PACKAGER_T1_BA
176a0 53 48 5f 47 45 54 5f 50 41 43 4b 45 54 5f 46 4f  SH_GET_PACKET_FO
176b0 52 4d 41 54 5f 56 45 52 53 49 4f 4e 5f 54 31 5f  RMAT_VERSION_T1_
176c0 52 45 53 55 4c 54 22 0a 20 20 20 20 69 66 20 5b  RESULT".    if [
176d0 20 22 24 53 5f 50 41 43 4b 45 54 5f 46 4f 52 4d   "$S_PACKET_FORM
176e0 41 54 22 20 3d 3d 20 22 75 6e 73 75 70 70 6f 72  AT" == "unsuppor
176f0 74 65 64 5f 62 79 5f 74 68 69 73 5f 73 63 72 69  ted_by_this_scri
17700 70 74 5f 76 65 72 73 69 6f 6e 22 20 5d 3b 20 74  pt_version" ]; t
17710 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68 6f  hen.        echo
17720 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f   "".        echo
17730 20 22 54 68 65 72 65 20 65 78 69 73 74 73 20 61   "There exists a
17740 20 70 6f 73 73 69 62 69 6c 69 74 79 20 74 68 61   possibility tha
17750 74 20 74 68 65 20 22 0a 20 20 20 20 20 20 20 20  t the ".        
17760 65 63 68 6f 20 22 53 69 6c 6b 74 6f 72 72 65 6e  echo "Silktorren
17770 74 20 70 61 63 6b 65 74 20 63 61 6e 64 69 64 61  t packet candida
17780 74 65 20 69 73 20 61 63 74 75 61 6c 6c 79 20 4f  te is actually O
17790 4b 2c 20 62 75 74 20 22 0a 20 20 20 20 20 20 20  K, but ".       
177a0 20 65 63 68 6f 20 22 74 68 69 73 20 69 73 20 61   echo "this is a
177b0 6e 20 6f 6c 64 65 72 20 76 65 72 73 69 6f 6e 20  n older version 
177c0 6f 66 20 74 68 65 20 53 69 6c 6b 74 6f 72 72 65  of the Silktorre
177d0 6e 74 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  nt implementatio
177e0 6e 20 61 6e 64 20 22 0a 20 20 20 20 20 20 20 20  n and ".        
177f0 65 63 68 6f 20 22 74 68 65 20 6f 6c 64 65 72 20  echo "the older 
17800 76 65 72 73 69 6f 6e 20 64 6f 65 73 20 6e 6f 74  version does not
17810 20 73 75 70 70 6f 72 74 20 22 0a 20 20 20 20 20   support ".     
17820 20 20 20 65 63 68 6f 20 22 6e 65 77 65 72 20 53     echo "newer S
17830 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b 65  ilktorrent packe
17840 74 20 66 6f 72 6d 61 74 73 2e 20 22 0a 20 20 20  t formats. ".   
17850 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20 66       echo "The f
17860 69 6c 65 20 70 61 74 68 20 6f 66 20 74 68 65 20  ile path of the 
17870 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63 6b  Silktorrent pack
17880 65 74 20 63 61 6e 64 69 64 61 74 65 3a 22 0a 20  et candidate:". 
17890 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
178a0 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
178b0 20 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20   $S_FP_0".      
178c0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
178d0 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 35    echo "GUID=='5
178e0 61 61 37 38 31 34 37 2d 32 63 31 30 2d 34 66 36  aa78147-2c10-4f6
178f0 33 2d 39 34 37 64 2d 38 30 32 30 37 30 65 30 33  3-947d-802070e03
17900 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
17910 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
17920 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
17930 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
17940 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
17950 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
17960 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
17970 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f      local S_TMP_
17980 31 3d 22 22 0a 20 20 20 20 69 66 20 5b 20 22 24  1="".    if [ "$
17990 53 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41 54 22  S_PACKET_FORMAT"
179a0 20 3d 3d 20 22 73 69 6c 6b 74 6f 72 72 65 6e 74   == "silktorrent
179b0 5f 70 61 63 6b 65 74 5f 66 6f 72 6d 61 74 5f 76  _packet_format_v
179c0 65 72 73 69 6f 6e 5f 31 22 20 5d 3b 20 74 68 65  ersion_1" ]; the
179d0 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d  n.        func_m
179e0 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  mmv_silktorrent_
179f0 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68  packager_t1_bash
17a00 5f 62 6c 6f 62 32 66 69 6c 65 6e 61 6d 65 5f 74  _blob2filename_t
17a10 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20  1 "$S_FP_0".    
17a20 20 20 20 20 23 65 63 68 6f 20 22 24 53 5f 46 55      #echo "$S_FU
17a30 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52  NC_MMMV_SILKTORR
17a40 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
17a50 42 41 53 48 5f 42 4c 4f 42 32 46 49 4c 45 4e 41  BASH_BLOB2FILENA
17a60 4d 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20  ME_T1_RESULT".  
17a70 20 20 20 20 20 20 53 5f 54 4d 50 5f 31 3d 22 24        S_TMP_1="$
17a80 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b  S_FUNC_MMMV_SILK
17a90 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
17aa0 5f 54 31 5f 42 41 53 48 5f 42 4c 4f 42 32 46 49  _T1_BASH_BLOB2FI
17ab0 4c 45 4e 41 4d 45 5f 54 31 5f 52 45 53 55 4c 54  LENAME_T1_RESULT
17ac0 22 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d  ".    fi.    #--
17ad0 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  --.    if [ "$S_
17ae0 54 4d 50 5f 31 22 20 3d 3d 20 22 22 20 5d 3b 20  TMP_1" == "" ]; 
17af0 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63 68  then.        ech
17b00 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
17b10 6f 20 22 54 68 69 73 20 73 63 72 69 70 74 20 69  o "This script i
17b20 73 20 66 6c 61 77 65 64 2e 22 0a 20 20 20 20 20  s flawed.".     
17b30 20 20 20 65 63 68 6f 20 22 49 74 20 73 68 6f 75     echo "It shou
17b40 6c 64 20 68 61 76 65 20 74 68 72 6f 77 6e 20 62  ld have thrown b
17b50 65 66 6f 72 65 20 74 68 65 20 63 6f 6e 74 72 6f  efore the contro
17b60 6c 20 66 6c 6f 77 20 72 65 61 63 68 65 73 20 74  l flow reaches t
17b70 68 69 73 20 6c 69 6e 65 2e 22 0a 20 20 20 20 20  his line.".     
17b80 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
17b90 33 31 38 63 63 61 33 35 2d 34 66 33 39 2d 34 61  318cca35-4f39-4a
17ba0 32 63 2d 39 33 37 64 2d 38 30 32 30 37 30 65 30  2c-937d-802070e0
17bb0 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65  31e7'".        e
17bc0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23  cho "".        #
17bd0 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
17be0 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
17bf0 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
17c00 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
17c10 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
17c20 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50  .    local S_TMP
17c30 5f 30 3d 22 60 62 61 73 65 6e 61 6d 65 20 24 53  _0="`basename $S
17c40 5f 46 50 5f 30 60 22 20 23 20 54 68 65 20 53 5f  _FP_0`" # The S_
17c50 54 4d 50 5f 30 20 6d 75 73 74 20 62 65 20 65 76  TMP_0 must be ev
17c60 61 6c 75 61 74 65 64 20 0a 20 20 20 20 20 20 20  aluated .       
17c70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17c90 23 20 61 66 74 65 72 20 74 68 65 20 76 61 72 69  # after the vari
17ca0 6f 75 73 20 66 75 6e 63 74 69 6f 6e 73 20 74 6f  ous functions to
17cb0 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20   .              
17cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17cd0 20 20 20 20 20 20 20 20 20 23 20 63 6f 75 6e 74           # count
17ce0 65 72 20 61 20 73 69 74 75 61 74 69 6f 6e 2c 20  er a situation, 
17cf0 77 68 65 72 65 20 0a 20 20 20 20 20 20 20 20 20  where .         
17d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20                # 
17d20 74 68 65 20 53 5f 54 4d 50 5f 30 20 69 73 20 6f  the S_TMP_0 is o
17d30 76 65 72 77 72 69 74 74 65 6e 20 0a 20 20 20 20  verwritten .    
17d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d60 20 20 20 23 20 62 79 20 74 68 65 20 6e 61 6d 65     # by the name
17d70 2d 63 61 6c 63 20 66 75 6e 63 74 69 6f 6e 20 0a  -calc function .
17d80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17d90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17da0 20 20 20 20 20 20 20 23 20 6f 72 20 62 79 20 6f         # or by o
17db0 6e 65 20 6f 66 20 74 68 65 20 73 75 62 2d 66 75  ne of the sub-fu
17dc0 6e 63 74 69 6f 6e 73 0a 20 20 20 20 20 20 20 20  nctions.        
17dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                 #
17df0 20 6f 66 20 74 68 65 20 6e 61 6d 65 2d 63 61 6c   of the name-cal
17e00 63 20 66 75 6e 63 74 69 6f 6e 2e 0a 20 20 20 20  c function..    
17e10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17e20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17e30 20 20 20 23 20 54 68 65 20 66 6c 61 77 20 6f 63     # The flaw oc
17e40 63 75 72 73 2c 20 77 68 65 6e 20 74 68 65 20 0a  curs, when the .
17e50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17e60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17e70 20 20 20 20 20 20 20 23 20 53 5f 54 4d 50 5f 30         # S_TMP_0
17e80 20 69 73 20 75 73 65 64 20 77 69 74 68 69 6e 20   is used within 
17e90 74 68 65 20 0a 20 20 20 20 20 20 20 20 20 20 20  the .           
17ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17eb0 20 20 20 20 20 20 20 20 20 20 20 20 23 20 6e 61              # na
17ec0 6d 65 2d 63 61 6c 63 20 66 75 6e 63 74 69 6f 6e  me-calc function
17ed0 20 77 69 74 68 6f 75 74 20 20 0a 20 20 20 20 20   without  .     
17ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17ef0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17f00 20 20 23 20 64 65 63 6c 61 72 69 6e 67 20 69 74    # declaring it
17f10 20 74 6f 20 62 65 20 61 20 6c 6f 63 61 6c 0a 20   to be a local. 
17f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17f30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
17f40 20 20 20 20 20 20 23 20 76 61 72 69 61 62 6c 65        # variable
17f50 2e 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  ..    #--------.
17f60 20 20 20 20 23 65 63 68 6f 20 22 53 5f 46 50 5f      #echo "S_FP_
17f70 30 3d 3d 24 53 5f 46 50 5f 30 22 0a 20 20 20 20  0==$S_FP_0".    
17f80 23 65 63 68 6f 20 22 53 5f 54 4d 50 5f 30 3d 3d  #echo "S_TMP_0==
17f90 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 23 65  $S_TMP_0".    #e
17fa0 63 68 6f 20 22 53 5f 54 4d 50 5f 31 3d 3d 24 53  cho "S_TMP_1==$S
17fb0 5f 54 4d 50 5f 31 22 0a 20 20 20 20 6c 6f 63 61  _TMP_1".    loca
17fc0 6c 20 53 5f 4f 55 54 3d 22 22 0a 20 20 20 20 69  l S_OUT="".    i
17fd0 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d  f [ "$S_TMP_1" =
17fe0 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20  = "$S_TMP_0" ]; 
17ff0 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 4f  then.        S_O
18000 55 54 3d 22 76 65 72 69 66 69 63 61 74 69 6f 6e  UT="verification
18010 5f 70 61 73 73 65 64 22 0a 20 20 20 20 65 6c 73  _passed".    els
18020 65 0a 20 20 20 20 20 20 20 20 53 5f 4f 55 54 3d  e.        S_OUT=
18030 22 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 66 61  "verification_fa
18040 69 6c 65 64 22 0a 20 20 20 20 66 69 0a 20 20 20  iled".    fi.   
18050 20 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c   S_FUNC_MMMV_SIL
18060 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
18070 52 5f 54 31 5f 42 41 53 48 5f 56 45 52 49 46 59  R_T1_BASH_VERIFY
18080 5f 46 49 4c 45 5f 4e 41 4d 45 5f 54 31 5f 52 45  _FILE_NAME_T1_RE
18090 53 55 4c 54 3d 22 24 53 5f 4f 55 54 22 0a 7d 20  SULT="$S_OUT".} 
180a0 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b  # func_mmmv_silk
180b0 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72  torrent_packager
180c0 5f 74 31 5f 62 61 73 68 5f 76 65 72 69 66 79 5f  _t1_bash_verify_
180d0 66 69 6c 65 5f 6e 61 6d 65 5f 74 31 0a 0a 0a 23  file_name_t1...#
180e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
180f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18110 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18120 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63  ----------..func
18130 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
18140 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
18150 73 68 5f 74 65 73 74 5f 31 28 29 20 7b 20 0a 20  sh_test_1() { . 
18160 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 30 3d     local S_FP_0=
18170 22 24 31 22 20 23 20 50 61 74 68 20 74 6f 20 74  "$1" # Path to t
18180 68 65 20 66 69 6c 65 2e 20 0a 20 20 20 20 23 2d  he file. .    #-
18190 2d 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  ---.    func_mmm
181a0 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61  v_silktorrent_pa
181b0 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65  ckager_t1_bash_e
181c0 78 63 5f 61 73 73 65 72 74 5f 77 72 61 70 70 61  xc_assert_wrappa
181d0 62 6c 65 5f 66 69 6c 65 5f 65 78 69 73 74 73 5f  ble_file_exists_
181e0 74 31 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20  t1 "$S_FP_0".   
181f0 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 65   #--------.    e
18200 63 68 6f 20 22 22 0a 20 20 20 20 23 2d 2d 2d 2d  cho "".    #----
18210 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 74  .    func_mmmv_t
18220 69 67 65 72 68 61 73 68 5f 74 31 20 22 24 53 5f  igerhash_t1 "$S_
18230 46 50 5f 30 22 0a 20 20 20 20 65 63 68 6f 20 22  FP_0".    echo "
18240 20 20 20 20 20 20 20 54 69 67 65 72 3a 20 24 53         Tiger: $S
18250 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 54 49 47 45 52  _FUNC_MMMV_TIGER
18260 48 41 53 48 5f 54 31 5f 52 45 53 55 4c 54 22 0a  HASH_T1_RESULT".
18270 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 77 68      func_mmmv_wh
18280 69 72 6c 70 6f 6f 6c 68 61 73 68 5f 74 31 20 22  irlpoolhash_t1 "
18290 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 65 63 68  $S_FP_0".    ech
182a0 6f 20 22 20 20 20 57 68 69 72 6c 70 6f 6f 6c 3a  o "   Whirlpool:
182b0 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 57 48   $S_FUNC_MMMV_WH
182c0 49 52 4c 50 4f 4f 4c 48 41 53 48 5f 54 31 5f 52  IRLPOOLHASH_T1_R
182d0 45 53 55 4c 54 22 0a 20 20 20 20 66 75 6e 63 5f  ESULT".    func_
182e0 6d 6d 6d 76 5f 73 68 61 32 35 36 5f 74 31 20 22  mmmv_sha256_t1 "
182f0 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 65 63 68  $S_FP_0".    ech
18300 6f 20 22 20 20 20 20 20 20 53 48 41 32 35 36 3a  o "      SHA256:
18310 20 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 48   $S_FUNC_MMMV_SH
18320 41 32 35 36 5f 54 31 5f 52 45 53 55 4c 54 22 0a  A256_T1_RESULT".
18330 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 66 69      func_mmmv_fi
18340 6c 65 73 69 7a 65 5f 74 31 20 22 24 53 5f 46 50  lesize_t1 "$S_FP
18350 5f 30 22 0a 20 20 20 20 65 63 68 6f 20 22 20 20  _0".    echo "  
18360 20 66 69 6c 65 20 73 69 7a 65 3a 20 24 53 5f 46   file size: $S_F
18370 55 4e 43 5f 4d 4d 4d 56 5f 46 49 4c 45 53 49 5a  UNC_MMMV_FILESIZ
18380 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20 20  E_T1_RESULT".   
18390 20 23 2d 2d 2d 2d 0a 20 20 20 20 65 63 68 6f 20   #----.    echo 
183a0 22 22 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  "".} # func_mmmv
183b0 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
183c0 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 74 65  kager_t1_bash_te
183d0 73 74 5f 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d  st_1...#--------
183e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
183f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18410 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18420 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  --..func_mmmv_si
18430 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
18440 65 72 5f 74 31 5f 62 61 73 68 5f 77 72 61 70 5f  er_t1_bash_wrap_
18450 74 31 28 29 20 7b 0a 20 20 20 20 6c 6f 63 61 6c  t1() {.    local
18460 20 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 50   S_FP_0="$1" # P
18470 61 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 2e  ath to the file.
18480 20 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20   .    #----.    
18490 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
184a0 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
184b0 31 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72  1_bash_exc_asser
184c0 74 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65  t_wrappable_file
184d0 5f 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f 46  _exists_t1 "$S_F
184e0 50 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d  P_0".    #------
184f0 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  --.    func_mmmv
18500 5f 63 72 65 61 74 65 5f 74 6d 70 5f 66 6f 6c 64  _create_tmp_fold
18510 65 72 5f 74 31 0a 20 20 20 20 69 66 20 5b 20 22  er_t1.    if [ "
18520 24 53 5f 46 55 4e 43 5f 46 55 4e 43 5f 4d 4d 4d  $S_FUNC_FUNC_MMM
18530 56 5f 43 52 45 41 54 45 5f 54 4d 50 5f 46 4f 4c  V_CREATE_TMP_FOL
18540 44 45 52 5f 54 31 5f 52 45 53 55 4c 54 22 20 3d  DER_T1_RESULT" =
18550 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  = "" ]; then.   
18560 20 20 20 20 20 65 63 68 6f 20 22 54 68 69 73 20       echo "This 
18570 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
18580 2c 20 62 65 63 61 75 73 65 20 74 68 65 20 66 6f  , because the fo
18590 6c 64 65 72 20 22 0a 20 20 20 20 20 20 20 20 65  lder ".        e
185a0 63 68 6f 20 22 63 72 65 61 74 69 6f 6e 20 66 75  cho "creation fu
185b0 6e 63 74 69 6f 6e 20 73 68 6f 75 6c 64 20 68 61  nction should ha
185c0 76 65 20 74 68 72 6f 77 6e 20 22 0a 20 20 20 20  ve thrown ".    
185d0 20 20 20 20 65 63 68 6f 20 22 62 65 66 6f 72 65      echo "before
185e0 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 66 6c 6f   the control flo
185f0 77 20 72 65 61 63 68 65 73 20 74 68 69 73 20 62  w reaches this b
18600 72 61 6e 63 68 2e 22 20 0a 20 20 20 20 20 20 20  ranch." .       
18610 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 64 63   echo "GUID=='dc
18620 34 32 34 30 32 64 2d 37 65 31 37 2d 34 36 65 31  42402d-7e17-46e1
18630 2d 62 35 37 64 2d 38 30 32 30 37 30 65 30 33 31  -b57d-802070e031
18640 65 37 27 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  e7'".        #--
18650 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
18660 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
18670 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77   exit 1 # exit w
18680 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69  ith error.    fi
18690 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f  .    local S_FP_
186a0 54 4d 50 5f 30 3d 22 24 53 5f 46 55 4e 43 5f 46  TMP_0="$S_FUNC_F
186b0 55 4e 43 5f 4d 4d 4d 56 5f 43 52 45 41 54 45 5f  UNC_MMMV_CREATE_
186c0 54 4d 50 5f 46 4f 4c 44 45 52 5f 54 31 5f 52 45  TMP_FOLDER_T1_RE
186d0 53 55 4c 54 22 0a 20 20 20 20 69 66 20 5b 20 21  SULT".    if [ !
186e0 20 2d 65 20 22 24 53 5f 46 50 5f 54 4d 50 5f 30   -e "$S_FP_TMP_0
186f0 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
18700 20 20 65 63 68 6f 20 22 54 68 69 73 20 73 63 72    echo "This scr
18710 69 70 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a  ipt is flawed.".
18720 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 4d 61          echo "Ma
18730 79 20 62 65 20 73 6f 6d 65 20 6f 74 68 65 72 20  y be some other 
18740 74 68 72 65 61 64 20 64 65 6c 65 74 65 64 20 74  thread deleted t
18750 68 65 20 66 6f 6c 64 65 72 20 6f 72 22 0a 20 20  he folder or".  
18760 20 20 20 20 20 20 65 63 68 6f 20 22 74 68 65 20        echo "the 
18770 66 6f 6c 64 65 72 20 63 72 65 61 74 69 6f 6e 20  folder creation 
18780 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 65  function returne
18790 64 20 61 20 76 61 6c 69 64 20 70 61 74 68 2c 20  d a valid path, 
187a0 62 75 74 22 0a 20 20 20 20 20 20 20 20 65 63 68  but".        ech
187b0 6f 20 22 64 69 64 20 6e 6f 74 20 61 63 74 75 61  o "did not actua
187c0 6c 6c 79 20 63 72 65 61 74 65 20 74 68 65 20 66  lly create the f
187d0 6f 6c 64 65 72 20 74 68 61 74 20 69 74 20 77 61  older that it wa
187e0 73 20 73 75 70 70 6f 73 65 64 20 63 72 65 61 74  s supposed creat
187f0 65 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  e.".        echo
18800 20 22 53 5f 46 50 5f 54 4d 50 5f 30 3d 3d 24 53   "S_FP_TMP_0==$S
18810 5f 46 50 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20  _FP_TMP_0".     
18820 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27     echo "GUID=='
18830 33 35 31 31 33 38 39 64 2d 62 62 34 37 2d 34 31  3511389d-bb47-41
18840 38 35 2d 61 35 37 64 2d 38 30 32 30 37 30 65 30  85-a57d-802070e0
18850 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 23  31e7'".        #
18860 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20  ----.        cd 
18870 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20  $S_FP_ORIG.     
18880 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74     exit 1 # exit
18890 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20   with error.    
188a0 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d  fi.    #--------
188b0 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 54 4d 50  .    local S_TMP
188c0 5f 30 3d 22 22 20 23 20 64 65 63 6c 61 72 61 74  _0="" # declarat
188d0 69 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f  ion.    local S_
188e0 54 4d 50 5f 31 3d 22 22 20 23 20 64 65 63 6c 61  TMP_1="" # decla
188f0 72 61 74 69 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c  ration.    local
18900 20 53 5f 46 4e 5f 43 55 53 54 4f 4d 5f 48 45 41   S_FN_CUSTOM_HEA
18910 44 45 52 53 3d 22 63 75 73 74 6f 6d 5f 68 65 61  DERS="custom_hea
18920 64 65 72 73 22 0a 20 20 20 20 6c 6f 63 61 6c 20  ders".    local 
18930 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
18940 52 45 4e 54 5f 50 41 43 4b 45 54 3d 22 24 53 5f  RENT_PACKET="$S_
18950 46 50 5f 54 4d 50 5f 30 2f 73 69 6c 6b 74 6f 72  FP_TMP_0/silktor
18960 72 65 6e 74 5f 70 61 63 6b 65 74 22 0a 20 20 20  rent_packet".   
18970 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50 5f   local S_FP_TMP_
18980 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
18990 45 54 5f 54 41 52 3d 22 24 53 5f 46 50 5f 54 4d  ET_TAR="$S_FP_TM
189a0 50 5f 30 2f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f  P_0/silktorrent_
189b0 70 61 63 6b 65 74 2e 74 61 72 22 0a 20 20 20 20  packet.tar".    
189c0 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50 5f 50  local S_FP_TMP_P
189d0 41 59 4c 4f 41 44 3d 22 24 53 5f 46 50 5f 54 4d  AYLOAD="$S_FP_TM
189e0 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  P_SILKTORRENT_PA
189f0 43 4b 45 54 2f 70 61 79 6c 6f 61 64 22 0a 20 20  CKET/payload".  
18a00 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50    local S_FP_TMP
18a10 5f 48 45 41 44 45 52 3d 22 24 53 5f 46 50 5f 54  _HEADER="$S_FP_T
18a20 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MP_SILKTORRENT_P
18a30 41 43 4b 45 54 2f 68 65 61 64 65 72 22 0a 20 20  ACKET/header".  
18a40 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50    local S_FP_TMP
18a50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f 54 58 54  _HEADER_SALT_TXT
18a60 3d 22 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44  ="$S_FP_TMP_HEAD
18a70 45 52 2f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 73  ER/silktorrent_s
18a80 61 6c 74 2e 74 78 74 22 0a 20 20 20 20 66 75 6e  alt.txt".    fun
18a90 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f 66 6f  c_mmmv_create_fo
18aa0 6c 64 65 72 5f 69 66 5f 69 74 5f 64 6f 65 73 5f  lder_if_it_does_
18ab0 6e 6f 74 5f 61 6c 72 65 61 64 79 5f 65 78 69 73  not_already_exis
18ac0 74 5f 74 31 20 22 24 53 5f 46 50 5f 54 4d 50 5f  t_t1 "$S_FP_TMP_
18ad0 50 41 59 4c 4f 41 44 22 20 23 20 75 73 65 73 20  PAYLOAD" # uses 
18ae0 6d 6b 64 69 72 20 2d 70 0a 20 20 20 20 66 75 6e  mkdir -p.    fun
18af0 63 5f 6d 6d 6d 76 5f 63 72 65 61 74 65 5f 66 6f  c_mmmv_create_fo
18b00 6c 64 65 72 5f 69 66 5f 69 74 5f 64 6f 65 73 5f  lder_if_it_does_
18b10 6e 6f 74 5f 61 6c 72 65 61 64 79 5f 65 78 69 73  not_already_exis
18b20 74 5f 74 31 20 22 24 53 5f 46 50 5f 54 4d 50 5f  t_t1 "$S_FP_TMP_
18b30 48 45 41 44 45 52 22 0a 20 20 20 20 23 2d 2d 2d  HEADER".    #---
18b40 2d 2d 2d 2d 2d 0a 20 20 20 20 53 5f 54 4d 50 5f  -----.    S_TMP_
18b50 30 3d 22 60 70 77 64 60 2f 24 53 5f 46 4e 5f 43  0="`pwd`/$S_FN_C
18b60 55 53 54 4f 4d 5f 48 45 41 44 45 52 53 22 0a 20  USTOM_HEADERS". 
18b70 20 20 20 69 66 20 5b 20 2d 65 20 22 24 53 5f 54     if [ -e "$S_T
18b80 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
18b90 20 20 20 20 20 20 69 66 20 5b 20 21 20 2d 64 20        if [ ! -d 
18ba0 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68  "$S_TMP_0" ]; th
18bb0 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  en.            e
18bc0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
18bd0 20 20 20 65 63 68 6f 20 22 54 68 65 20 22 0a 20     echo "The ". 
18be0 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
18bf0 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  "".            e
18c00 63 68 6f 20 22 20 20 20 20 24 53 5f 54 4d 50 5f  cho "    $S_TMP_
18c10 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  0".            e
18c20 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
18c30 20 20 20 65 63 68 6f 20 22 65 78 69 73 74 73 2c     echo "exists,
18c40 20 62 75 74 20 69 74 20 69 73 20 6e 6f 74 20 61   but it is not a
18c50 20 66 6f 6c 64 65 72 2e 22 0a 20 20 20 20 20 20   folder.".      
18c60 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
18c70 3d 3d 27 34 36 65 39 65 37 33 34 2d 63 33 62 34  =='46e9e734-c3b4
18c80 2d 34 34 66 35 2d 38 34 37 64 2d 38 30 32 30 37  -44f5-847d-80207
18c90 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
18ca0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
18cb0 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a            #----.
18cc0 20 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24              cd $
18cd0 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
18ce0 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
18cf0 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
18d00 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20         fi.      
18d10 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
18d20 23 20 4e 75 6d 62 65 72 20 6f 66 20 66 69 6c 65  # Number of file
18d30 73 2f 66 6f 6c 64 65 72 73 20 69 6e 20 74 68 65  s/folders in the
18d40 20 24 53 5f 54 4d 50 5f 30 2c 20 69 66 20 63 6f   $S_TMP_0, if co
18d50 75 6e 74 65 64 20 6e 6f 6e 2d 72 65 63 75 72 73  unted non-recurs
18d60 69 76 65 6c 79 2e 0a 20 20 20 20 20 20 20 20 53  ively..        S
18d70 5f 54 4d 50 5f 31 3d 22 60 63 64 20 24 53 5f 54  _TMP_1="`cd $S_T
18d80 4d 50 5f 30 3b 20 72 75 62 79 20 2d 65 20 5c 22  MP_0; ruby -e \"
18d90 70 72 69 6e 74 28 44 69 72 3a 3a 67 6c 6f 62 28  print(Dir::glob(
18da0 27 2a 27 29 2e 73 69 7a 65 2e 74 6f 5f 73 29 5c  '*').size.to_s)\
18db0 22 60 22 20 0a 20 20 20 20 20 20 20 20 23 2d 2d  "`" .        #--
18dc0 2d 2d 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20  --.        if [ 
18dd0 22 24 53 5f 54 4d 50 5f 31 22 20 3d 3d 20 22 22  "$S_TMP_1" == ""
18de0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
18df0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
18e00 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54           echo "T
18e10 68 69 73 20 73 63 72 69 70 74 20 69 73 20 66 6c  his script is fl
18e20 61 77 65 64 2e 22 0a 20 20 20 20 20 20 20 20 20  awed.".         
18e30 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
18e40 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20 20         echo "   
18e50 20 70 77 64 3d 60 70 77 64 60 22 0a 20 20 20 20   pwd=`pwd`".    
18e60 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
18e70 20 20 53 5f 54 4d 50 5f 30 3d 24 53 5f 54 4d 50    S_TMP_0=$S_TMP
18e80 5f 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  _0".            
18e90 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
18ea0 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
18eb0 27 36 35 62 30 31 62 34 36 2d 66 64 62 62 2d 34  '65b01b46-fdbb-4
18ec0 61 61 30 2d 62 34 36 64 2d 38 30 32 30 37 30 65  aa0-b46d-802070e
18ed0 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
18ee0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
18ef0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
18f00 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53 5f            cd $S_
18f10 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
18f20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
18f30 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
18f40 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20 20       fi.        
18f50 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20  if [ "$S_TMP_1" 
18f60 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20  != "0" ]; then. 
18f70 20 20 20 20 20 20 20 20 20 20 20 63 70 20 2d 66             cp -f
18f80 20 2d 52 20 24 53 5f 54 4d 50 5f 30 20 24 53 5f   -R $S_TMP_0 $S_
18f90 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 2f 0a 20  FP_TMP_HEADER/. 
18fa0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 5b 20             if [ 
18fb0 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74  "$?" != "0" ]; t
18fc0 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
18fd0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
18fe0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
18ff0 20 22 54 68 65 20 72 65 63 75 72 73 69 76 65 20   "The recursive 
19000 63 6f 70 79 69 6e 67 20 6f 66 20 74 68 65 20 66  copying of the f
19010 6f 6c 64 65 72 20 22 0a 20 20 20 20 20 20 20 20  older ".        
19020 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
19030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19040 65 63 68 6f 20 22 20 20 20 20 24 53 5f 54 4d 50  echo "    $S_TMP
19050 5f 30 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  _0 ".           
19060 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
19070 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68               ech
19080 6f 20 22 66 61 69 6c 65 64 20 77 69 74 68 20 61  o "failed with a
19090 6e 20 65 72 72 6f 72 20 63 6f 64 65 20 6f 66 20  n error code of 
190a0 24 3f 2e 22 0a 20 20 20 20 20 20 20 20 20 20 20  $?.".           
190b0 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
190c0 3d 27 32 61 32 63 37 38 34 63 2d 33 31 64 34 2d  ='2a2c784c-31d4-
190d0 34 63 38 37 2d 38 31 36 64 2d 38 30 32 30 37 30  4c87-816d-802070
190e0 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
190f0 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22           echo ""
19100 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
19110 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
19120 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50 5f         cd $S_FP_
19130 4f 52 49 47 0a 20 20 20 20 20 20 20 20 20 20 20  ORIG.           
19140 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
19150 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
19160 20 20 20 20 20 20 20 20 20 20 66 69 0a 20 20 20            fi.   
19170 20 20 20 20 20 66 69 0a 20 20 20 20 66 69 0a 20       fi.    fi. 
19180 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20     #--------.   
19190 20 23 20 53 61 6c 74 69 6e 67 20 6d 61 6b 65 73   # Salting makes
191a0 20 73 75 72 65 20 74 68 61 74 20 69 74 20 69 73   sure that it is
191b0 20 6e 6f 74 20 70 6f 73 73 69 62 6c 65 20 74 6f   not possible to
191c0 20 0a 20 20 20 20 23 20 63 6f 6e 63 6c 75 64 65   .    # conclude
191d0 20 74 68 65 20 70 61 79 6c 6f 61 64 20 62 69 74   the payload bit
191e0 73 74 72 65 61 6d 20 66 72 6f 6d 20 74 68 65 20  stream from the 
191f0 0a 20 20 20 20 23 20 53 69 6c 6b 74 6f 72 72 65  .    # Silktorre
19200 6e 74 20 70 61 63 6b 65 74 20 28 66 69 6c 65 29  nt packet (file)
19210 20 6e 61 6d 65 2c 20 66 6f 72 63 69 6e 67 20 63   name, forcing c
19220 65 6e 73 6f 72 69 6e 67 0a 20 20 20 20 23 20 70  ensoring.    # p
19230 61 72 74 69 65 73 20 74 6f 20 64 6f 77 6e 6c 6f  arties to downlo
19240 61 64 20 70 61 63 6b 61 67 65 73 20 0a 20 20 20  ad packages .   
19250 20 23 20 74 68 61 74 20 74 68 65 79 20 61 72 65   # that they are
19260 20 6e 6f 74 20 6c 6f 6f 6b 69 6e 67 20 66 6f 72   not looking for
19270 20 61 6e 64 20 61 6c 6c 6f 77 69 6e 67 0a 20 20   and allowing.  
19280 20 20 23 20 63 65 6e 73 6f 72 73 68 69 70 20 64    # censorship d
19290 6f 64 67 65 72 73 20 74 6f 20 70 75 62 6c 69 73  odgers to publis
192a0 68 20 74 68 65 20 73 61 6d 65 20 70 61 79 6c 6f  h the same paylo
192b0 61 64 20 62 69 74 73 74 72 65 61 6d 0a 20 20 20  ad bitstream.   
192c0 20 23 20 69 6e 20 6d 75 6c 74 69 70 6c 65 2c 20   # in multiple, 
192d0 64 69 66 66 65 72 65 74 2c 20 53 69 6c 6b 74 6f  differet, Silkto
192e0 72 72 65 6e 74 20 70 61 63 6b 61 67 65 73 2e 0a  rrent packages..
192f0 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55      func_mmmv_GU
19300 49 44 5f 74 31 0a 20 20 20 20 65 63 68 6f 20 22  ID_t1.    echo "
19310 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49  $S_FUNC_MMMV_GUI
19320 44 5f 54 31 5f 52 45 53 55 4c 54 22 20 3e 3e 20  D_T1_RESULT" >> 
19330 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52  $S_FP_TMP_HEADER
19340 5f 53 41 4c 54 5f 54 58 54 0a 20 20 20 20 66 75  _SALT_TXT.    fu
19350 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a  nc_mmmv_GUID_t1.
19360 20 20 20 20 65 63 68 6f 20 22 24 53 5f 46 55 4e      echo "$S_FUN
19370 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52  C_MMMV_GUID_T1_R
19380 45 53 55 4c 54 22 20 3e 3e 20 24 53 5f 46 50 5f  ESULT" >> $S_FP_
19390 54 4d 50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f  TMP_HEADER_SALT_
193a0 54 58 54 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d  TXT.    func_mmm
193b0 76 5f 47 55 49 44 5f 74 31 0a 20 20 20 20 65 63  v_GUID_t1.    ec
193c0 68 6f 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56  ho "$S_FUNC_MMMV
193d0 5f 47 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22  _GUID_T1_RESULT"
193e0 20 3e 3e 20 24 53 5f 46 50 5f 54 4d 50 5f 48 45   >> $S_FP_TMP_HE
193f0 41 44 45 52 5f 53 41 4c 54 5f 54 58 54 0a 20 20  ADER_SALT_TXT.  
19400 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 47 55 49 44    func_mmmv_GUID
19410 5f 74 31 0a 20 20 20 20 65 63 68 6f 20 22 24 53  _t1.    echo "$S
19420 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47 55 49 44 5f  _FUNC_MMMV_GUID_
19430 54 31 5f 52 45 53 55 4c 54 22 20 3e 3e 20 24 53  T1_RESULT" >> $S
19440 5f 46 50 5f 54 4d 50 5f 48 45 41 44 45 52 5f 53  _FP_TMP_HEADER_S
19450 41 4c 54 5f 54 58 54 0a 20 20 20 20 66 75 6e 63  ALT_TXT.    func
19460 5f 6d 6d 6d 76 5f 47 55 49 44 5f 74 31 0a 20 20  _mmmv_GUID_t1.  
19470 20 20 65 63 68 6f 20 22 24 53 5f 46 55 4e 43 5f    echo "$S_FUNC_
19480 4d 4d 4d 56 5f 47 55 49 44 5f 54 31 5f 52 45 53  MMMV_GUID_T1_RES
19490 55 4c 54 22 20 3e 3e 20 24 53 5f 46 50 5f 54 4d  ULT" >> $S_FP_TM
194a0 50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f 54 58  P_HEADER_SALT_TX
194b0 54 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  T.    func_mmmv_
194c0 47 55 49 44 5f 74 31 0a 20 20 20 20 65 63 68 6f  GUID_t1.    echo
194d0 20 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 47   "$S_FUNC_MMMV_G
194e0 55 49 44 5f 54 31 5f 52 45 53 55 4c 54 22 20 3e  UID_T1_RESULT" >
194f0 3e 20 24 53 5f 46 50 5f 54 4d 50 5f 48 45 41 44  > $S_FP_TMP_HEAD
19500 45 52 5f 53 41 4c 54 5f 54 58 54 0a 20 20 20 20  ER_SALT_TXT.    
19510 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
19520 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23  ----------.    #
19530 20 54 68 65 20 66 69 6c 65 20 73 69 7a 65 2f 53   The file size/S
19540 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 6b 63 6b  ilktorrent pakck
19550 65 74 20 73 69 7a 65 20 6d 75 73 74 20 61 6c 73  et size must als
19560 6f 20 62 65 20 73 61 6c 74 65 64 2e 0a 20 20 20  o be salted..   
19570 20 69 66 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f   if [ "$S_SILKTO
19580 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54  RRENT_PACKAGER_T
19590 31 5f 41 43 54 49 4f 4e 5f 57 41 52 50 5f 4e 52  1_ACTION_WARP_NR
195a0 41 4e 44 22 20 21 3d 20 22 22 20 5d 3b 20 74 68  AND" != "" ]; th
195b0 65 6e 0a 20 20 20 20 20 20 20 20 72 75 62 79 20  en.        ruby 
195c0 2d 65 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  -e \.           
195d0 20 22 52 61 6e 64 6f 6d 2e 6e 65 77 5f 73 65 65   "Random.new_see
195e0 64 3b 69 3d 30 3b 5c 0a 20 20 20 20 20 20 20 20  d;i=0;\.        
195f0 20 20 20 20 20 70 75 74 73 20 27 27 3b 5c 0a 20       puts '';\. 
19600 20 20 20 20 20 20 20 20 20 20 20 20 28 31 30 2b              (10+
19610 24 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  $S_SILKTORRENT_P
19620 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
19630 4e 5f 57 41 52 50 5f 4e 52 41 4e 44 29 2e 74 69  N_WARP_NRAND).ti
19640 6d 65 73 7b 5c 0a 20 20 20 20 20 20 20 20 20 20  mes{\.          
19650 20 20 20 20 20 20 20 69 3d 69 2b 31 3b 5c 0a 20         i=i+1;\. 
19660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19670 70 72 69 6e 74 28 72 61 6e 64 28 31 30 2a 2a 36  print(rand(10**6
19680 29 2e 74 6f 5f 73 28 31 36 29 29 3b 5c 0a 20 20  ).to_s(16));\.  
19690 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69                 i
196a0 66 28 28 69 25 31 30 29 3d 3d 30 29 20 74 68 65  f((i%10)==0) the
196b0 6e 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20  n \.            
196c0 20 20 20 20 20 20 20 20 20 70 75 74 73 20 27 27           puts ''
196d0 3b 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  ;\.             
196e0 20 20 20 20 20 20 20 20 69 3d 30 3b 5c 0a 20 20          i=0;\.  
196f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65                 e
19700 6e 64 3b 5c 0a 20 20 20 20 20 20 20 20 20 20 20  nd;\.           
19710 20 20 7d 22 20 5c 0a 20 20 20 20 20 20 20 20 20    }" \.         
19720 20 20 20 20 3e 3e 20 24 53 5f 46 50 5f 54 4d 50      >> $S_FP_TMP
19730 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f 54 58 54  _HEADER_SALT_TXT
19740 0a 20 20 20 20 65 6c 73 65 20 0a 20 20 20 20 20  .    else .     
19750 20 20 20 72 75 62 79 20 2d 65 20 5c 0a 20 20 20     ruby -e \.   
19760 20 20 20 20 20 20 20 20 20 22 52 61 6e 64 6f 6d           "Random
19770 2e 6e 65 77 5f 73 65 65 64 3b 69 3d 30 3b 5c 0a  .new_seed;i=0;\.
19780 20 20 20 20 20 20 20 20 20 20 20 20 20 70 75 74               put
19790 73 20 27 27 3b 5c 0a 20 20 20 20 20 20 20 20 20  s '';\.         
197a0 20 20 20 20 72 61 6e 64 28 31 30 2a 2a 36 29 2e      rand(10**6).
197b0 74 69 6d 65 73 7b 5c 0a 20 20 20 20 20 20 20 20  times{\.        
197c0 20 20 20 20 20 20 20 20 20 69 3d 69 2b 31 3b 5c           i=i+1;\
197d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
197e0 20 20 70 72 69 6e 74 28 72 61 6e 64 28 31 30 2a    print(rand(10*
197f0 2a 36 29 2e 74 6f 5f 73 28 31 36 29 29 3b 5c 0a  *6).to_s(16));\.
19800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19810 20 69 66 28 28 69 25 31 30 29 3d 3d 30 29 20 74   if((i%10)==0) t
19820 68 65 6e 20 5c 0a 20 20 20 20 20 20 20 20 20 20  hen \.          
19830 20 20 20 20 20 20 20 20 20 20 20 70 75 74 73 20             puts 
19840 27 27 3b 5c 0a 20 20 20 20 20 20 20 20 20 20 20  '';\.           
19850 20 20 20 20 20 20 20 20 20 20 69 3d 30 3b 5c 0a            i=0;\.
19860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
19870 20 65 6e 64 3b 5c 0a 20 20 20 20 20 20 20 20 20   end;\.         
19880 20 20 20 20 7d 22 20 5c 0a 20 20 20 20 20 20 20      }" \.       
19890 20 20 20 20 20 20 3e 3e 20 24 53 5f 46 50 5f 54        >> $S_FP_T
198a0 4d 50 5f 48 45 41 44 45 52 5f 53 41 4c 54 5f 54  MP_HEADER_SALT_T
198b0 58 54 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  XT.    fi.    if
198c0 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d   [ "$?" != "0" ]
198d0 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
198e0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
198f0 63 68 6f 20 22 53 61 6c 74 69 6e 67 20 66 61 69  cho "Salting fai
19900 6c 65 64 2e 20 5c 24 3f 3d 3d 24 3f 22 0a 20 20  led. \$?==$?".  
19910 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44        echo "GUID
19920 3d 3d 27 33 39 32 33 32 34 35 32 2d 62 63 66 64  =='39232452-bcfd
19930 2d 34 32 63 62 2d 39 31 35 64 2d 38 30 32 30 37  -42cb-915d-80207
19940 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20  0e031e7'".      
19950 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
19960 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20    #----.        
19970 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20  cd $S_FP_ORIG.  
19980 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65        exit 1 # e
19990 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20  xit with error. 
199a0 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d     fi.    #-----
199b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
199c0 2d 2d 2d 2d 0a 20 20 20 20 63 70 20 2d 66 20 24  ----.    cp -f $
199d0 53 5f 46 50 5f 30 20 24 53 5f 46 50 5f 54 4d 50  S_FP_0 $S_FP_TMP
199e0 5f 50 41 59 4c 4f 41 44 2f 0a 20 20 20 20 69 66  _PAYLOAD/.    if
199f0 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d   [ "$?" != "0" ]
19a00 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
19a10 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
19a20 63 68 6f 20 22 54 68 65 20 63 6f 6d 6d 61 6e 64  cho "The command
19a30 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
19a40 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
19a50 22 20 20 20 20 63 70 20 2d 66 20 5c 24 53 5f 46  "    cp -f \$S_F
19a60 50 5f 30 20 5c 24 53 5f 46 50 5f 54 4d 50 5f 50  P_0 \$S_FP_TMP_P
19a70 41 59 4c 4f 41 44 2f 20 22 0a 20 20 20 20 20 20  AYLOAD/ ".      
19a80 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
19a90 20 20 65 63 68 6f 20 22 66 61 69 6c 65 64 2e 20    echo "failed. 
19aa0 45 69 74 68 65 72 20 74 68 69 73 20 73 63 72 69  Either this scri
19ab0 70 74 20 69 73 20 66 6c 61 77 65 64 20 6f 72 20  pt is flawed or 
19ac0 73 6f 6d 65 74 68 69 6e 67 20 65 6c 73 65 20 77  something else w
19ad0 65 6e 74 20 77 72 6f 6e 67 2e 20 22 0a 20 20 20  ent wrong. ".   
19ae0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
19af0 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 53       echo "    S
19b00 5f 46 50 5f 30 3d 3d 24 53 5f 46 50 5f 30 22 0a  _FP_0==$S_FP_0".
19b10 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
19b20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20 20          echo "  
19b30 20 20 53 5f 46 50 5f 54 4d 50 5f 50 41 59 4c 4f    S_FP_TMP_PAYLO
19b40 41 44 3d 24 53 5f 46 50 5f 54 4d 50 5f 50 41 59  AD=$S_FP_TMP_PAY
19b50 4c 4f 41 44 22 0a 20 20 20 20 20 20 20 20 65 63  LOAD".        ec
19b60 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
19b70 68 6f 20 22 47 55 49 44 3d 3d 27 37 38 36 61 62  ho "GUID=='786ab
19b80 38 32 38 2d 32 33 35 36 2d 34 36 39 39 2d 61 35  828-2356-4699-a5
19b90 35 64 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  5d-802070e031e7'
19ba0 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
19bb0 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a  ".        #----.
19bc0 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46 50          cd $S_FP
19bd0 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65 78  _ORIG.        ex
19be0 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68  it 1 # exit with
19bf0 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20   error.    fi.  
19c00 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20    #--------.    
19c10 6c 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50 5f 4f  local S_FP_TMP_O
19c20 52 49 47 5f 30 3d 22 60 70 77 64 60 22 0a 20 20  RIG_0="`pwd`".  
19c30 20 20 63 64 20 24 53 5f 46 50 5f 54 4d 50 5f 53    cd $S_FP_TMP_S
19c40 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45  ILKTORRENT_PACKE
19c50 54 2f 2e 2e 20 0a 20 20 20 20 74 61 72 20 2d 63  T/.. .    tar -c
19c60 66 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b  f $S_FP_TMP_SILK
19c70 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f 54  TORRENT_PACKET_T
19c80 41 52 20 2e 2f 60 62 61 73 65 6e 61 6d 65 20 24  AR ./`basename $
19c90 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
19ca0 52 45 4e 54 5f 50 41 43 4b 45 54 60 20 32 3e 2f  RENT_PACKET` 2>/
19cb0 64 65 76 2f 6e 75 6c 6c 0a 20 20 20 20 63 64 20  dev/null.    cd 
19cc0 24 53 5f 46 50 5f 54 4d 50 5f 4f 52 49 47 5f 30  $S_FP_TMP_ORIG_0
19cd0 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22 20 21  .    if [ "$?" !
19ce0 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  = "0" ]; then.  
19cf0 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20        echo "".  
19d00 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65 20        echo "The 
19d10 63 6f 6d 6d 61 6e 64 20 22 0a 20 20 20 20 20 20  command ".      
19d20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
19d30 20 20 65 63 68 6f 20 22 20 20 20 20 74 61 72 20    echo "    tar 
19d40 2d 63 66 20 5c 24 53 5f 46 50 5f 54 4d 50 5f 53  -cf \$S_FP_TMP_S
19d50 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45  ILKTORRENT_PACKE
19d60 54 5f 54 41 52 20 5c 24 53 5f 46 50 5f 54 4d 50  T_TAR \$S_FP_TMP
19d70 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
19d80 4b 45 54 20 22 0a 20 20 20 20 20 20 20 20 65 63  KET ".        ec
19d90 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
19da0 68 6f 20 22 66 61 69 6c 65 64 2e 20 45 69 74 68  ho "failed. Eith
19db0 65 72 20 74 68 69 73 20 73 63 72 69 70 74 20 69  er this script i
19dc0 73 20 66 6c 61 77 65 64 20 6f 72 20 73 6f 6d 65  s flawed or some
19dd0 74 68 69 6e 67 20 65 6c 73 65 20 77 65 6e 74 20  thing else went 
19de0 77 72 6f 6e 67 2e 20 22 0a 20 20 20 20 20 20 20  wrong. ".       
19df0 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
19e00 20 65 63 68 6f 20 22 20 20 20 20 53 5f 46 50 5f   echo "    S_FP_
19e10 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  TMP_SILKTORRENT_
19e20 50 41 43 4b 45 54 3d 24 53 5f 46 50 5f 54 4d 50  PACKET=$S_FP_TMP
19e30 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
19e40 4b 45 54 22 0a 20 20 20 20 20 20 20 20 65 63 68  KET".        ech
19e50 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
19e60 6f 20 22 20 20 20 20 53 5f 46 50 5f 54 4d 50 5f  o "    S_FP_TMP_
19e70 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
19e80 45 54 5f 54 41 52 3d 3d 24 53 5f 46 50 5f 54 4d  ET_TAR==$S_FP_TM
19e90 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  P_SILKTORRENT_PA
19ea0 43 4b 45 54 5f 54 41 52 22 0a 20 20 20 20 20 20  CKET_TAR".      
19eb0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
19ec0 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 62    echo "GUID=='b
19ed0 31 62 65 35 34 33 63 2d 30 63 38 31 2d 34 32 63  1be543c-0c81-42c
19ee0 38 2d 38 32 35 64 2d 38 30 32 30 37 30 65 30 33  8-825d-802070e03
19ef0 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
19f00 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
19f10 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
19f20 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
19f30 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
19f40 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
19f50 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  i.    #----.    
19f60 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
19f70 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
19f80 31 5f 62 61 73 68 5f 62 6c 6f 62 32 66 69 6c 65  1_bash_blob2file
19f90 6e 61 6d 65 5f 74 31 20 22 24 53 5f 46 50 5f 54  name_t1 "$S_FP_T
19fa0 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MP_SILKTORRENT_P
19fb0 41 43 4b 45 54 5f 54 41 52 22 0a 20 20 20 20 6c  ACKET_TAR".    l
19fc0 6f 63 61 6c 20 53 5f 46 50 5f 54 4d 50 5f 53 49  ocal S_FP_TMP_SI
19fd0 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54  LKTORRENT_PACKET
19fe0 5f 50 55 42 4c 49 53 48 49 4e 47 4e 41 4d 45 3d  _PUBLISHINGNAME=
19ff0 22 24 53 5f 46 50 5f 4f 52 49 47 2f 24 53 5f 46  "$S_FP_ORIG/$S_F
1a000 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52  UNC_MMMV_SILKTOR
1a010 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31  RENT_PACKAGER_T1
1a020 5f 42 41 53 48 5f 42 4c 4f 42 32 46 49 4c 45 4e  _BASH_BLOB2FILEN
1a030 41 4d 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20  AME_T1_RESULT". 
1a040 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20     #---------.  
1a050 20 20 23 20 54 68 65 20 32 3e 20 2f 64 65 76 2f    # The 2> /dev/
1a060 6e 75 6c 6c 20 70 61 72 74 20 69 73 20 64 75 65  null part is due
1a070 20 73 6f 6d 65 20 77 65 69 72 64 20 74 6f 20 42   some weird to B
1a080 53 44 20 70 65 63 75 6c 69 61 72 69 74 79 2e 20  SD peculiarity. 
1a090 0a 20 20 20 20 23 20 54 68 65 20 61 63 74 75 61  .    # The actua
1a0a0 6c 20 73 75 63 63 65 73 73 2f 66 61 69 6c 75 72  l success/failur
1a0b0 65 20 6f 66 20 74 68 65 20 6d 76 20 63 6f 6d 6d  e of the mv comm
1a0c0 61 6e 64 20 69 73 20 74 65 73 74 65 64 20 61 66  and is tested af
1a0d0 74 65 72 0a 20 20 20 20 23 20 69 74 73 20 65 78  ter.    # its ex
1a0e0 65 63 75 74 69 6f 6e 20 61 6e 79 77 61 79 2e 0a  ecution anyway..
1a0f0 20 20 20 20 6d 76 20 2d 66 20 24 53 5f 46 50 5f      mv -f $S_FP_
1a100 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f  TMP_SILKTORRENT_
1a110 50 41 43 4b 45 54 5f 54 41 52 20 24 53 5f 46 50  PACKET_TAR $S_FP
1a120 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  _TMP_SILKTORRENT
1a130 5f 50 41 43 4b 45 54 5f 50 55 42 4c 49 53 48 49  _PACKET_PUBLISHI
1a140 4e 47 4e 41 4d 45 20 32 3e 20 2f 64 65 76 2f 6e  NGNAME 2> /dev/n
1a150 75 6c 6c 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  ull.    #-------
1a160 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 3f 22  --.    if [ "$?"
1a170 20 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a   != "0" ]; then.
1a180 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1a190 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 6f          echo "So
1a1a0 6d 65 74 68 69 6e 67 20 77 65 6e 74 20 77 72 6f  mething went wro
1a1b0 6e 67 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  ng.".        ech
1a1c0 6f 20 22 54 68 65 20 72 65 6e 61 6d 69 6e 67 20  o "The renaming 
1a1d0 61 6e 64 20 63 6f 70 79 69 6e 67 20 6f 66 20 22  and copying of "
1a1e0 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
1a1f0 20 20 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c     $S_FP_TMP_SIL
1a200 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 5f  KTORRENT_PACKET_
1a210 54 41 52 20 22 0a 20 20 20 20 20 20 20 20 65 63  TAR ".        ec
1a220 68 6f 20 22 74 6f 20 22 0a 20 20 20 20 20 20 20  ho "to ".       
1a230 20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50   echo "    $S_FP
1a240 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  _TMP_SILKTORRENT
1a250 5f 50 41 43 4b 45 54 5f 50 55 42 4c 49 53 48 49  _PACKET_PUBLISHI
1a260 4e 47 4e 41 4d 45 20 22 0a 20 20 20 20 20 20 20  NGNAME ".       
1a270 20 65 63 68 6f 20 22 66 61 69 6c 65 64 2e 22 0a   echo "failed.".
1a280 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55          echo "GU
1a290 49 44 3d 3d 27 63 64 30 63 64 39 33 65 2d 64 37  ID=='cd0cd93e-d7
1a2a0 37 64 2d 34 62 61 66 2d 39 32 35 64 2d 38 30 32  7d-4baf-925d-802
1a2b0 30 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20  070e031e7'".    
1a2c0 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
1a2d0 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
1a2e0 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
1a2f0 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23          exit 1 #
1a300 20 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72   exit with error
1a310 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b  .    fi.    if [
1a320 20 21 20 2d 65 20 22 24 53 5f 46 50 5f 54 4d 50   ! -e "$S_FP_TMP
1a330 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1a340 4b 45 54 5f 50 55 42 4c 49 53 48 49 4e 47 4e 41  KET_PUBLISHINGNA
1a350 4d 45 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  ME" ]; then.    
1a360 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20      echo "".    
1a370 20 20 20 20 65 63 68 6f 20 22 53 6f 6d 65 74 68      echo "Someth
1a380 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67 2e 22  ing went wrong."
1a390 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 54  .        echo "T
1a3a0 68 65 20 72 65 6e 61 6d 69 6e 67 20 61 6e 64 20  he renaming and 
1a3b0 63 6f 70 79 69 6e 67 20 6f 66 20 22 0a 20 20 20  copying of ".   
1a3c0 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1a3d0 20 20 20 20 20 65 63 68 6f 20 22 20 20 20 20 24       echo "    $
1a3e0 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f 52  S_FP_TMP_SILKTOR
1a3f0 52 45 4e 54 5f 50 41 43 4b 45 54 5f 54 41 52 20  RENT_PACKET_TAR 
1a400 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
1a410 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22  ".        echo "
1a420 74 6f 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  to ".        ech
1a430 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
1a440 6f 20 22 20 20 20 20 24 53 5f 46 50 5f 54 4d 50  o "    $S_FP_TMP
1a450 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1a460 4b 45 54 5f 50 55 42 4c 49 53 48 49 4e 47 4e 41  KET_PUBLISHINGNA
1a470 4d 45 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  ME ".        ech
1a480 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63 68  o "".        ech
1a490 6f 20 22 66 61 69 6c 65 64 2e 20 54 68 65 20 6d  o "failed. The m
1a4a0 76 20 63 6f 6d 6d 61 6e 64 20 73 75 63 63 65 65  v command succee
1a4b0 64 2c 20 62 75 74 20 66 6f 72 20 73 6f 6d 65 20  d, but for some 
1a4c0 72 65 61 73 6f 6e 20 22 0a 20 20 20 20 20 20 20  reason ".       
1a4d0 20 65 63 68 6f 20 22 74 68 65 20 64 65 73 74 69   echo "the desti
1a4e0 6e 61 74 69 6f 6e 20 66 69 6c 65 20 64 6f 65 73  nation file does
1a4f0 20 6e 6f 74 20 65 78 69 73 74 2e 22 0a 20 20 20   not exist.".   
1a500 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
1a510 3d 27 63 39 61 33 62 31 33 66 2d 33 36 62 34 2d  ='c9a3b13f-36b4-
1a520 34 61 61 63 2d 39 35 35 64 2d 38 30 32 30 37 30  4aac-955d-802070
1a530 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
1a540 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
1a550 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
1a560 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
1a570 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
1a580 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
1a590 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
1a5a0 2d 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76  --.    func_mmmv
1a5b0 5f 64 65 6c 65 74 65 5f 74 6d 70 5f 66 6f 6c 64  _delete_tmp_fold
1a5c0 65 72 5f 74 31 20 22 24 53 5f 46 50 5f 54 4d 50  er_t1 "$S_FP_TMP
1a5d0 5f 30 22 0a 20 20 20 20 69 66 20 5b 20 2d 65 20  _0".    if [ -e 
1a5e0 22 24 53 5f 46 50 5f 54 4d 50 5f 30 22 20 5d 3b  "$S_FP_TMP_0" ];
1a5f0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
1a600 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
1a610 68 6f 20 22 53 6f 6d 65 74 68 69 6e 67 20 77 65  ho "Something we
1a620 6e 74 20 77 72 6f 6e 67 2e 22 0a 20 20 20 20 20  nt wrong.".     
1a630 20 20 20 65 63 68 6f 20 22 54 68 65 20 64 65 6c     echo "The del
1a640 65 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 65 6d  etion of the tem
1a650 70 6f 72 61 72 79 20 66 6f 6c 64 65 72 2c 20 22  porary folder, "
1a660 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22  .        echo ""
1a670 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 20  .        echo " 
1a680 20 20 20 24 53 5f 46 50 5f 54 4d 50 5f 30 22 0a     $S_FP_TMP_0".
1a690 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a          echo "".
1a6a0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 66 61          echo "fa
1a6b0 69 6c 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65  iled.".        e
1a6c0 63 68 6f 20 22 47 55 49 44 3d 3d 27 61 32 30 32  cho "GUID=='a202
1a6d0 30 63 33 62 2d 33 30 63 66 2d 34 39 65 65 2d 61  0c3b-30cf-49ee-a
1a6e0 34 34 64 2d 38 30 32 30 37 30 65 30 33 31 65 37  44d-802070e031e7
1a6f0 27 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  '".        echo 
1a700 22 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  "".        #----
1a710 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
1a720 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
1a730 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69 74  xit 1 # exit wit
1a740 68 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 7d  h error.    fi.}
1a750 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c   # func_mmmv_sil
1a760 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
1a770 72 5f 74 31 5f 62 61 73 68 5f 77 72 61 70 5f 74  r_t1_bash_wrap_t
1a780 31 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  1...#-----------
1a790 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a7a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a7b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1a7c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1a7d0 0a 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74  .func_mmmv_silkt
1a7e0 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
1a7f0 74 31 5f 62 61 73 68 5f 75 6e 77 72 61 70 5f 74  t1_bash_unwrap_t
1a800 31 28 29 20 7b 0a 20 20 20 20 6c 6f 63 61 6c 20  1() {.    local 
1a810 53 5f 46 50 5f 30 3d 22 24 31 22 20 23 20 50 61  S_FP_0="$1" # Pa
1a820 74 68 20 74 6f 20 74 68 65 20 66 69 6c 65 2e 20  th to the file. 
1a830 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 66  .    #----.    f
1a840 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72  unc_mmmv_silktor
1a850 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31  rent_packager_t1
1a860 5f 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72 74  _bash_exc_assert
1a870 5f 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65 5f  _wrappable_file_
1a880 65 78 69 73 74 73 5f 74 31 20 22 24 53 5f 46 50  exists_t1 "$S_FP
1a890 5f 30 22 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d  _0".    #-------
1a8a0 2d 0a 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f  -.    func_mmmv_
1a8b0 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b  silktorrent_pack
1a8c0 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 76 65 72  ager_t1_bash_ver
1a8d0 69 66 79 5f 66 69 6c 65 5f 6e 61 6d 65 5f 74 31  ify_file_name_t1
1a8e0 20 22 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 6c   "$S_FP_0".    l
1a8f0 6f 63 61 6c 20 53 5f 50 41 43 4b 45 54 5f 46 4f  ocal S_PACKET_FO
1a900 52 4d 41 54 3d 22 24 53 5f 46 55 4e 43 5f 4d 4d  RMAT="$S_FUNC_MM
1a910 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MV_SILKTORRENT_P
1a920 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53 48 5f  ACKAGER_T1_BASH_
1a930 47 45 54 5f 50 41 43 4b 45 54 5f 46 4f 52 4d 41  GET_PACKET_FORMA
1a940 54 5f 56 45 52 53 49 4f 4e 5f 54 31 5f 52 45 53  T_VERSION_T1_RES
1a950 55 4c 54 22 0a 20 20 20 20 69 66 20 5b 20 22 24  ULT".    if [ "$
1a960 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 53 49 4c 4b  S_FUNC_MMMV_SILK
1a970 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
1a980 5f 54 31 5f 42 41 53 48 5f 56 45 52 49 46 59 5f  _T1_BASH_VERIFY_
1a990 46 49 4c 45 5f 4e 41 4d 45 5f 54 31 5f 52 45 53  FILE_NAME_T1_RES
1a9a0 55 4c 54 22 20 21 3d 20 22 76 65 72 69 66 69 63  ULT" != "verific
1a9b0 61 74 69 6f 6e 5f 70 61 73 73 65 64 22 20 5d 3b  ation_passed" ];
1a9c0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65 63   then.        ec
1a9d0 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65 63  ho "".        ec
1a9e0 68 6f 20 22 54 68 65 20 53 69 6c 6b 74 6f 72 72  ho "The Silktorr
1a9f0 65 6e 74 20 70 61 63 6b 65 74 20 63 61 6e 64 69  ent packet candi
1aa00 64 61 74 65 2c 20 22 0a 20 20 20 20 20 20 20 20  date, ".        
1aa10 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1aa20 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f  echo "    $S_FP_
1aa30 30 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  0".        echo 
1aa40 22 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20  "".        echo 
1aa50 22 66 61 69 6c 65 64 20 53 69 6c 6b 74 6f 72 72  "failed Silktorr
1aa60 65 6e 74 20 70 61 63 6b 65 74 20 6e 61 6d 65 20  ent packet name 
1aa70 76 65 72 69 66 69 63 61 74 69 6f 6e 2e 22 0a 20  verification.". 
1aa80 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 65         echo "The
1aa90 72 65 20 65 78 69 73 74 73 20 61 20 70 6f 73 73  re exists a poss
1aaa0 69 62 69 6c 69 74 79 20 74 68 61 74 20 74 68 65  ibility that the
1aab0 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
1aac0 22 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63  "Silktorrent pac
1aad0 6b 65 74 20 63 61 6e 64 69 64 61 74 65 20 69 73  ket candidate is
1aae0 20 61 63 74 75 61 6c 6c 79 20 4f 4b 2c 20 62 75   actually OK, bu
1aaf0 74 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f  t ".        echo
1ab00 20 22 74 68 69 73 20 69 73 20 61 6e 20 6f 6c 64   "this is an old
1ab10 65 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68  er version of th
1ab20 65 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 69 6d  e Silktorrent im
1ab30 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 61 6e 64  plementation and
1ab40 20 22 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20   ".        echo 
1ab50 22 74 68 69 73 2c 20 74 68 65 20 6f 6c 64 65 72  "this, the older
1ab60 2c 20 76 65 72 73 69 6f 6e 20 64 6f 65 73 20 6e  , version does n
1ab70 6f 74 20 73 75 70 70 6f 72 74 20 22 0a 20 20 20  ot support ".   
1ab80 20 20 20 20 20 65 63 68 6f 20 22 6e 65 77 65 72       echo "newer
1ab90 20 53 69 6c 6b 74 6f 72 72 65 6e 74 20 70 61 63   Silktorrent pac
1aba0 6b 65 74 20 66 6f 72 6d 61 74 73 2e 20 22 0a 20  ket formats. ". 
1abb0 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 55 49         echo "GUI
1abc0 44 3d 3d 27 36 34 33 35 31 65 38 34 2d 36 39 34  D=='64351e84-694
1abd0 37 2d 34 64 64 30 2d 39 35 34 64 2d 38 30 32 30  7-4dd0-954d-8020
1abe0 37 30 65 30 33 31 65 37 27 22 0a 20 20 20 20 20  70e031e7'".     
1abf0 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
1ac00 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20     #----.       
1ac10 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20   cd $S_FP_ORIG. 
1ac20 20 20 20 20 20 20 20 65 78 69 74 20 31 20 23 20         exit 1 # 
1ac30 65 78 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a  exit with error.
1ac40 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
1ac50 2d 2d 2d 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53  ----.    local S
1ac60 42 5f 46 4f 52 4d 41 54 5f 42 52 41 4e 43 48 5f  B_FORMAT_BRANCH_
1ac70 45 58 49 53 54 53 5f 49 4e 5f 54 48 49 53 5f 46  EXISTS_IN_THIS_F
1ac80 55 4e 43 54 49 4f 4e 3d 22 66 22 0a 20 20 20 20  UNCTION="f".    
1ac90 69 66 20 5b 20 22 24 53 5f 50 41 43 4b 45 54 5f  if [ "$S_PACKET_
1aca0 46 4f 52 4d 41 54 22 20 3d 3d 20 22 73 69 6c 6b  FORMAT" == "silk
1acb0 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74 5f 66  torrent_packet_f
1acc0 6f 72 6d 61 74 5f 76 65 72 73 69 6f 6e 5f 31 22  ormat_version_1"
1acd0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1ace0 20 53 42 5f 46 4f 52 4d 41 54 5f 42 52 41 4e 43   SB_FORMAT_BRANC
1acf0 48 5f 45 58 49 53 54 53 5f 49 4e 5f 54 48 49 53  H_EXISTS_IN_THIS
1ad00 5f 46 55 4e 43 54 49 4f 4e 3d 22 74 22 0a 20 20  _FUNCTION="t".  
1ad10 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1ad20 20 20 20 20 6c 6f 63 61 6c 20 53 5f 46 50 5f 54      local S_FP_T
1ad30 4d 50 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  MP_SILKTORRENT_P
1ad40 41 43 4b 45 54 3d 22 60 70 77 64 60 2f 73 69 6c  ACKET="`pwd`/sil
1ad50 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74 22  ktorrent_packet"
1ad60 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20 2d 65  .        if [ -e
1ad70 20 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54   $S_FP_TMP_SILKT
1ad80 4f 52 52 45 4e 54 5f 50 41 43 4b 45 54 20 5d 3b  ORRENT_PACKET ];
1ad90 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20   then.          
1ada0 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
1adb0 20 20 20 20 20 20 65 63 68 6f 20 22 54 6f 20 61        echo "To a
1adc0 76 6f 69 64 20 61 63 63 69 64 65 6e 74 61 6c 20  void accidental 
1add0 64 65 6c 65 74 69 6f 6e 20 6f 66 20 66 69 6c 65  deletion of file
1ade0 73 2c 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  s, ".           
1adf0 20 65 63 68 6f 20 22 61 6e 64 20 73 6f 6d 65 20   echo "and some 
1ae00 6f 74 68 65 72 20 74 79 70 65 73 20 6f 66 20 66  other types of f
1ae10 6c 61 77 73 2c 20 22 0a 20 20 20 20 20 20 20 20  laws, ".        
1ae20 20 20 20 20 65 63 68 6f 20 22 74 68 65 72 65 20      echo "there 
1ae30 69 73 20 61 20 72 65 71 75 69 72 65 6d 65 6e 74  is a requirement
1ae40 20 74 68 61 74 20 74 68 65 20 66 6f 6c 64 65 72   that the folder
1ae50 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65   ".            e
1ae60 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
1ae70 20 20 20 65 63 68 6f 20 22 20 20 20 20 2e 2f 73     echo "    ./s
1ae80 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65  ilktorrent_packe
1ae90 74 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  t".            e
1aea0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
1aeb0 20 20 20 65 63 68 6f 20 22 6d 75 73 74 20 62 65     echo "must be
1aec0 20 65 78 70 6c 69 63 69 74 6c 79 20 64 65 6c 65   explicitly dele
1aed0 74 65 64 20 62 65 66 6f 72 65 20 63 61 6c 6c 69  ted before calli
1aee0 6e 67 20 74 68 69 73 20 73 63 72 69 70 74 2e 22  ng this script."
1aef0 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1af00 6f 20 22 47 55 49 44 3d 3d 27 35 37 31 65 33 38  o "GUID=='571e38
1af10 37 35 2d 33 32 65 30 2d 34 38 64 38 2d 39 33 33  75-32e0-48d8-933
1af20 64 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22  d-802070e031e7'"
1af30 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68  .            ech
1af40 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20  o "".           
1af50 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20   #----.         
1af60 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47     cd $S_FP_ORIG
1af70 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69  .            exi
1af80 74 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20  t 1 # exit with 
1af90 65 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69  error.        fi
1afa0 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20  .        #----. 
1afb0 20 20 20 20 20 20 20 74 61 72 20 2d 78 66 20 24         tar -xf $
1afc0 53 5f 46 50 5f 30 20 32 3e 2f 64 65 76 2f 6e 75  S_FP_0 2>/dev/nu
1afd0 6c 6c 0a 20 20 20 20 20 20 20 20 69 66 20 5b 20  ll.        if [ 
1afe0 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74  "$?" != "0" ]; t
1aff0 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20  hen.            
1b000 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1b010 20 20 20 20 65 63 68 6f 20 22 53 6f 6d 65 74 68      echo "Someth
1b020 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67 2e 20  ing went wrong. 
1b030 54 68 65 20 63 6f 6d 6d 61 6e 64 20 22 0a 20 20  The command ".  
1b040 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22            echo "
1b050 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63  ".            ec
1b060 68 6f 20 22 20 20 20 20 74 61 72 20 2d 78 66 20  ho "    tar -xf 
1b070 24 53 5f 46 50 5f 30 22 0a 20 20 20 20 20 20 20  $S_FP_0".       
1b080 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1b090 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 65           echo "e
1b0a0 78 69 74 65 64 20 77 69 74 68 20 61 6e 20 65 72  xited with an er
1b0b0 72 6f 72 20 63 6f 64 65 2c 20 77 68 69 63 68 20  ror code, which 
1b0c0 69 73 20 24 3f 20 2e 22 0a 20 20 20 20 20 20 20  is $? .".       
1b0d0 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
1b0e0 3d 27 31 34 38 35 62 38 33 65 2d 30 31 30 39 2d  ='1485b83e-0109-
1b0f0 34 30 31 61 2d 62 31 33 64 2d 38 30 32 30 37 30  401a-b13d-802070
1b100 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
1b110 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20       echo "".   
1b120 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20           #----. 
1b130 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
1b140 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
1b150 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
1b160 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
1b170 20 20 20 20 20 20 66 69 0a 20 20 20 20 20 20 20        fi.       
1b180 20 72 6d 20 2d 66 20 24 53 5f 46 50 5f 54 4d 50   rm -f $S_FP_TMP
1b190 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1b1a0 4b 45 54 2f 68 65 61 64 65 72 2f 73 69 6c 6b 74  KET/header/silkt
1b1b0 6f 72 72 65 6e 74 5f 73 61 6c 74 2e 74 78 74 0a  orrent_salt.txt.
1b1c0 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20          #----.  
1b1d0 20 20 20 20 20 20 69 66 20 5b 20 21 20 2d 65 20        if [ ! -e 
1b1e0 24 53 5f 46 50 5f 54 4d 50 5f 53 49 4c 4b 54 4f  $S_FP_TMP_SILKTO
1b1f0 52 52 45 4e 54 5f 50 41 43 4b 45 54 20 5d 3b 20  RRENT_PACKET ]; 
1b200 74 68 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20  then.           
1b210 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
1b220 20 20 20 20 20 65 63 68 6f 20 22 53 6f 6d 65 74       echo "Somet
1b230 68 69 6e 67 20 77 65 6e 74 20 77 72 6f 6e 67 2e  hing went wrong.
1b240 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65   ".            e
1b250 63 68 6f 20 22 54 68 65 20 75 6e 70 61 63 6b 69  cho "The unpacki
1b260 6e 67 20 6f 66 20 74 68 65 20 53 69 6c 6b 74 6f  ng of the Silkto
1b270 72 72 65 6e 74 20 70 61 63 6b 65 74 20 77 69 74  rrent packet wit
1b280 68 20 74 68 65 20 70 61 74 68 20 6f 66 20 22 0a  h the path of ".
1b290 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
1b2a0 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
1b2b0 65 63 68 6f 20 22 20 20 20 20 24 53 5f 46 50 5f  echo "    $S_FP_
1b2c0 30 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 65  0".            e
1b2d0 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 20  cho "".         
1b2e0 20 20 20 65 63 68 6f 20 22 66 61 69 6c 65 64 2e     echo "failed.
1b2f0 20 54 68 65 20 66 6f 6c 64 65 72 20 5c 22 73 69   The folder \"si
1b300 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 65 74  lktorrent_packet
1b310 5c 22 20 22 0a 20 20 20 20 20 20 20 20 20 20 20  \" ".           
1b320 20 65 63 68 6f 20 22 69 73 20 6d 69 73 73 69 6e   echo "is missin
1b330 67 20 61 66 74 65 72 20 74 68 65 20 5c 22 74 61  g after the \"ta
1b340 72 5c 22 20 65 78 69 74 65 64 20 77 69 74 68 6f  r\" exited witho
1b350 75 74 20 61 6e 79 20 65 72 72 6f 72 73 2e 22 0a  ut any errors.".
1b360 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
1b370 20 22 47 55 49 44 3d 3d 27 35 36 38 36 30 35 35   "GUID=='5686055
1b380 31 2d 30 64 38 66 2d 34 64 32 65 2d 61 33 32 64  1-0d8f-4d2e-a32d
1b390 2d 38 30 32 30 37 30 65 30 33 31 65 37 27 22 0a  -802070e031e7'".
1b3a0 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f              echo
1b3b0 20 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20   "".            
1b3c0 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20  #----.          
1b3d0 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
1b3e0 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74              exit
1b3f0 20 31 20 23 20 65 78 69 74 20 77 69 74 68 20 65   1 # exit with e
1b400 72 72 6f 72 0a 20 20 20 20 20 20 20 20 66 69 0a  rror.        fi.
1b410 20 20 20 20 66 69 20 23 20 73 69 6c 6b 74 6f 72      fi # silktor
1b420 72 65 6e 74 5f 70 61 63 6b 65 74 5f 66 6f 72 6d  rent_packet_form
1b430 61 74 5f 76 65 72 73 69 6f 6e 5f 31 0a 20 20 20  at_version_1.   
1b440 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69   #--------.    i
1b450 66 20 5b 20 22 24 53 42 5f 46 4f 52 4d 41 54 5f  f [ "$SB_FORMAT_
1b460 42 52 41 4e 43 48 5f 45 58 49 53 54 53 5f 49 4e  BRANCH_EXISTS_IN
1b470 5f 54 48 49 53 5f 46 55 4e 43 54 49 4f 4e 22 20  _THIS_FUNCTION" 
1b480 21 3d 20 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20  != "t" ]; then. 
1b490 20 20 20 20 20 20 20 65 63 68 6f 20 22 22 0a 20         echo "". 
1b4a0 20 20 20 20 20 20 20 65 63 68 6f 20 22 54 68 69         echo "Thi
1b4b0 73 20 73 63 72 69 70 74 20 69 73 20 66 6c 61 77  s script is flaw
1b4c0 65 64 2e 22 0a 20 20 20 20 20 20 20 20 65 63 68  ed.".        ech
1b4d0 6f 20 22 54 68 65 72 65 20 69 73 20 61 74 20 6c  o "There is at l
1b4e0 65 61 73 74 20 6f 6e 65 20 62 72 61 6e 63 68 20  east one branch 
1b4f0 6d 69 73 73 69 6e 67 20 66 72 6f 6d 20 74 68 69  missing from thi
1b500 73 20 66 75 6e 63 74 69 6f 6e 2e 22 0a 20 20 20  s function.".   
1b510 20 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d       echo "GUID=
1b520 3d 27 31 32 38 31 33 66 35 35 2d 32 36 35 32 2d  ='12813f55-2652-
1b530 34 33 32 39 2d 61 34 32 64 2d 38 30 32 30 37 30  4329-a42d-802070
1b540 65 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20  e031e7'".       
1b550 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20   echo "".       
1b560 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
1b570 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
1b580 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
1b590 69 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20  it with error.  
1b5a0 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
1b5b0 2d 2d 0a 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76  --.} # func_mmmv
1b5c0 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
1b5d0 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 75 6e  kager_t1_bash_un
1b5e0 77 72 61 70 5f 74 31 0a 0a 0a 23 2d 2d 2d 2d 2d  wrap_t1...#-----
1b5f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b610 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b620 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b630 2d 2d 2d 2d 2d 0a 0a 66 75 6e 63 5f 6d 6d 6d 76  -----..func_mmmv
1b640 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
1b650 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 76 65  kager_t1_bash_ve
1b660 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65  rify_packet_name
1b670 5f 66 6f 72 6d 61 74 5f 76 31 28 29 7b 0a 20 20  _format_v1(){.  
1b680 20 20 6c 6f 63 61 6c 20 53 5f 50 41 43 4b 45 54    local S_PACKET
1b690 5f 4e 41 4d 45 5f 43 41 4e 44 49 44 41 54 45 3d  _NAME_CANDIDATE=
1b6a0 22 24 31 22 20 0a 20 20 20 20 69 66 20 5b 20 22  "$1" .    if [ "
1b6b0 24 53 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f 43  $S_PACKET_NAME_C
1b6c0 41 4e 44 49 44 41 54 45 22 20 3d 3d 20 22 22 20  ANDIDATE" == "" 
1b6d0 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
1b6e0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1b6f0 65 63 68 6f 20 22 54 68 69 73 20 73 63 72 69 70  echo "This scrip
1b700 74 20 69 73 20 66 6c 61 77 65 64 2e 22 0a 20 20  t is flawed.".  
1b710 20 20 20 20 20 20 65 63 68 6f 20 22 49 6e 70 75        echo "Inpu
1b720 74 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 73  t verification s
1b730 68 6f 75 6c 64 20 68 61 76 65 20 63 61 75 67 68  hould have caugh
1b740 74 20 74 68 65 20 22 0a 20 20 20 20 20 20 20 20  t the ".        
1b750 65 63 68 6f 20 22 5c 22 5c 22 20 63 61 73 65 20  echo "\"\" case 
1b760 62 65 66 6f 72 65 20 74 68 65 20 63 6f 6e 74 72  before the contr
1b770 6f 6c 20 66 6c 6f 77 20 72 65 61 63 68 65 73 20  ol flow reaches 
1b780 74 68 69 73 20 6c 69 6e 65 2e 22 0a 20 20 20 20  this line.".    
1b790 20 20 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d      echo "GUID==
1b7a0 27 64 63 64 61 61 32 31 34 2d 65 35 63 66 2d 34  'dcdaa214-e5cf-4
1b7b0 64 38 39 2d 61 33 32 64 2d 38 30 32 30 37 30 65  d89-a32d-802070e
1b7c0 30 33 31 65 37 27 22 0a 20 20 20 20 20 20 20 20  031e7'".        
1b7d0 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20  echo "".        
1b7e0 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64  #----.        cd
1b7f0 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20   $S_FP_ORIG.    
1b800 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78 69      exit 1 # exi
1b810 74 20 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20  t with error.   
1b820 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d   fi.    #-------
1b830 2d 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 4f 55  -.    local S_OU
1b840 54 3d 22 76 65 72 69 66 69 63 61 74 69 6f 6e 5f  T="verification_
1b850 66 61 69 6c 65 64 22 20 23 20 6f 70 70 6f 73 69  failed" # opposi
1b860 74 65 3a 20 22 76 65 72 69 66 69 63 61 74 69 6f  te: "verificatio
1b870 6e 5f 70 61 73 73 65 64 22 0a 0a 20 20 20 20 23  n_passed"..    #
1b880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b890 20 20 20 20 20 20 20 20 20 72 67 78 5f 69 6e 5f           rgx_in_
1b8a0 72 75 62 79 3d 2f 76 5b 5c 64 5d 7b 34 7d 5b 5f  ruby=/v[\d]{4}[_
1b8b0 5d 2f 0a 20 20 20 20 23 20 20 20 20 20 20 20 20  ]/.    #        
1b8c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b8d0 20 72 67 78 5f 69 6e 5f 72 75 62 79 3d 2f 73 5b   rgx_in_ruby=/s[
1b8e0 5c 64 5d 2b 5b 5f 5d 2f 0a 20 20 20 20 23 20 20  \d]+[_]/.    #  
1b8f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b900 20 20 20 20 20 20 20 72 67 78 5f 69 6e 5f 72 75         rgx_in_ru
1b910 62 79 3d 2f 68 5b 5c 64 61 62 63 64 65 66 5d 7b  by=/h[\dabcdef]{
1b920 36 34 7d 5b 5f 5d 2f 0a 20 20 20 20 23 20 20 20  64}[_]/.    #   
1b930 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b940 20 20 20 20 20 20 72 67 78 5f 69 6e 5f 72 75 62        rgx_in_rub
1b950 79 3d 2f 69 5b 5c 64 61 62 63 64 65 66 5d 7b 34  y=/i[\dabcdef]{4
1b960 38 7d 24 2f 20 20 20 23 20 6c 61 63 6b 73 20 74  8}$/   # lacks t
1b970 68 65 20 65 6e 64 69 6e 67 20 22 5f 22 20 0a 20  he ending "_" . 
1b980 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20 20     #            
1b990 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b9a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1b9b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20                # 
1b9c0 66 6f 72 20 64 62 20 69 6e 64 65 78 20 6f 70 74  for db index opt
1b9d0 69 6d 69 7a 61 74 69 6f 6e 0a 20 20 20 20 23 2d  imization.    #-
1b9e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b9f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ba20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
1ba30 20 20 23 6c 6f 63 61 6c 20 53 5f 52 55 42 59 5f    #local S_RUBY_
1ba40 52 45 47 45 58 3d 22 2f 5e 58 5b 5c 5c 64 61 62  REGEX="/^X[\\dab
1ba50 63 64 65 66 5d 7b 34 38 7d 69 5b 5f 5d 5b 5c 5c  cdef]{48}i[_][\\
1ba60 64 61 62 63 64 65 66 5d 7b 36 34 7d 68 5b 5f 5d  dabcdef]{64}h[_]
1ba70 5b 5c 5c 64 5d 2b 73 5b 5f 5d 5b 5c 5c 64 5d 7b  [\\d]+s[_][\\d]{
1ba80 34 7d 76 2e 73 74 62 6c 6f 62 58 5c 24 2f 22 0a  4}v.stblobX\$/".
1ba90 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 20      #           
1baa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1bab0 20 20 54 69 67 65 72 20 20 20 20 20 20 20 20 20    Tiger         
1bac0 20 20 20 20 53 48 41 2d 32 35 36 20 20 20 20 20      SHA-256     
1bad0 20 20 73 69 7a 65 20 20 20 20 20 76 65 72 73 69    size     versi
1bae0 6f 6e 0a 20 20 20 20 6c 6f 63 61 6c 20 53 5f 52  on.    local S_R
1baf0 55 42 59 5f 52 45 47 45 58 3d 22 2f 5e 58 5b 5c  UBY_REGEX="/^X[\
1bb00 5c 64 61 62 63 64 65 66 5d 7b 34 38 7d 69 5b 5f  \dabcdef]{48}i[_
1bb10 5d 5b 5c 5c 64 61 62 63 64 65 66 5d 7b 36 34 7d  ][\\dabcdef]{64}
1bb20 68 5b 5f 5d 5b 5c 5c 64 5d 2b 73 5b 5f 5d 31 30  h[_][\\d]+s[_]10
1bb30 30 30 76 2e 73 74 62 6c 6f 62 58 5c 24 2f 22 0a  00v.stblobX\$/".
1bb40 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
1bb50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bb60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bb70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bb80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bb90 2d 2d 2d 0a 20 20 20 20 23 20 74 65 73 74 20 63  ---.    # test c
1bba0 61 73 65 73 3a 20 0a 20 20 20 20 23 20 20 20 20  ases: .    #    
1bbb0 20 72 75 62 79 20 2d 65 20 22 70 75 74 73 28 41   ruby -e "puts(A
1bbc0 52 47 56 5b 30 5d 29 22 20 61 61 5c 20 62 62 0a  RGV[0])" aa\ bb.
1bbd0 20 20 20 20 23 20 20 20 20 20 70 72 69 6e 74 66      #     printf
1bbe0 20 25 73 20 22 25 71 22 20 22 41 41 20 42 42 20   %s "%q" "AA BB 
1bbf0 43 43 20 24 5e 20 5c 20 2f 20 27 5c 60 5c 22 20  CC $^ \ / '\`\" 
1bc00 3c 3e 28 29 5b 5d 3b 2e 7b 7d 22 20 7c 20 78 61  <>()[];.{}" | xa
1bc10 72 67 73 20 72 75 62 79 20 2d 65 20 22 70 75 74  rgs ruby -e "put
1bc20 73 28 41 52 47 56 5b 30 5d 29 22 0a 20 20 20 20  s(ARGV[0])".    
1bc30 23 20 0a 20 20 20 20 23 20 54 68 65 20 53 5f 50  # .    # The S_P
1bc40 41 43 4b 45 54 5f 4e 41 4d 45 5f 43 41 4e 44 49  ACKET_NAME_CANDI
1bc50 44 41 54 45 20 6d 69 67 68 74 20 63 6f 6e 74 61  DATE might conta
1bc60 69 6e 20 76 61 72 69 6f 75 73 20 71 75 6f 74 61  in various quota
1bc70 74 69 6f 6e 20 6d 61 72 6b 73 2e 0a 20 20 20 20  tion marks..    
1bc80 23 20 49 66 20 69 74 20 64 6f 65 73 2c 20 74 68  # If it does, th
1bc90 65 6e 20 68 6f 70 65 66 75 6c 6c 79 20 69 74 20  en hopefully it 
1bca0 63 72 61 73 68 65 73 20 61 74 20 6c 65 61 73 74  crashes at least
1bcb0 20 73 6f 6d 65 74 68 69 6e 67 20 73 6f 20 74 68   something so th
1bcc0 61 74 0a 20 20 20 20 23 20 74 68 65 20 63 72 61  at.    # the cra
1bcd0 73 68 20 63 61 6e 20 62 65 20 64 65 74 65 63 74  sh can be detect
1bce0 65 64 20 66 72 6f 6d 20 74 68 65 20 22 24 3f 22  ed from the "$?"
1bcf0 2e 20 0a 20 20 20 20 23 20 54 68 65 20 73 75 72  . .    # The sur
1bd00 72 6f 75 6e 64 69 6e 67 20 58 2d 65 73 2c 20 58  rounding X-es, X
1bd10 3c 70 61 63 6b 65 74 20 6e 61 6d 65 20 63 61 6e  <packet name can
1bd20 64 69 64 61 74 65 20 73 74 72 69 6e 67 3e 58 2c  didate string>X,
1bd30 20 0a 20 20 20 20 23 20 61 72 65 20 74 6f 20 63   .    # are to c
1bd40 6f 75 6e 74 65 72 20 61 20 73 69 74 75 61 74 69  ounter a situati
1bd50 6f 6e 2c 20 77 68 65 72 65 20 74 68 65 20 66 69  on, where the fi
1bd60 6c 65 20 6e 61 6d 65 20 63 61 6e 64 69 64 61 74  le name candidat
1bd70 65 20 65 6e 64 73 0a 20 20 20 20 23 20 77 69 74  e ends.    # wit
1bd80 68 20 61 20 73 70 61 63 65 2c 20 6c 69 6b 65 20  h a space, like 
1bd90 22 66 6f 6f 20 22 20 61 6e 64 20 74 68 65 20 42  "foo " and the B
1bda0 61 73 68 20 72 65 61 64 73 20 74 68 65 20 63 6f  ash reads the co
1bdb0 6e 73 6f 6c 65 0a 20 20 20 20 23 20 61 72 67 75  nsole.    # argu
1bdc0 6d 65 6e 74 20 69 6e 20 61 73 20 22 66 6f 6f 22  ment in as "foo"
1bdd0 20 69 6e 20 73 74 65 61 64 20 6f 66 20 74 68 65   in stead of the
1bde0 20 22 66 6f 6f 20 22 2e 20 0a 20 20 20 20 23 2d   "foo ". .    #-
1bdf0 2d 2d 2d 0a 20 20 20 20 23 6c 6f 63 61 6c 20 53  ---.    #local S
1be00 5f 54 4d 50 5f 30 3d 22 60 70 72 69 6e 74 66 20  _TMP_0="`printf 
1be10 20 5c 22 25 71 5c 22 20 5c 22 27 24 53 5f 50 41   \"%q\" \"'$S_PA
1be20 43 4b 45 54 5f 4e 41 4d 45 5f 43 41 4e 44 49 44  CKET_NAME_CANDID
1be30 41 54 45 27 5c 22 20 7c 20 78 61 72 67 73 20 72  ATE'\" | xargs r
1be40 75 62 79 20 2d 65 20 5c 22 20 5c 0a 20 20 20 20  uby -e \" \.    
1be50 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 30 3d 22 60  local S_TMP_0="`
1be60 72 75 62 79 20 2d 65 20 5c 22 20 5c 0a 20 20 20  ruby -e \" \.   
1be70 20 20 20 20 20 73 5f 69 6e 3d 41 52 47 56 5b 30       s_in=ARGV[0
1be80 5d 3b 5c 0a 20 20 20 20 20 20 20 20 72 67 78 3d  ];\.        rgx=
1be90 24 53 5f 52 55 42 59 5f 52 45 47 45 58 3b 5c 0a  $S_RUBY_REGEX;\.
1bea0 20 20 20 20 20 20 20 20 6d 64 3d 73 5f 69 6e 2e          md=s_in.
1beb0 6d 61 74 63 68 28 72 67 78 29 3b 5c 0a 20 20 20  match(rgx);\.   
1bec0 20 20 20 20 20 73 5f 6f 75 74 3d 27 6e 6f 5f 6d       s_out='no_m
1bed0 61 74 63 68 27 3b 5c 0a 20 20 20 20 20 20 20 20  atch';\.        
1bee0 69 66 28 6d 64 21 3d 6e 69 6c 29 20 74 68 65 6e  if(md!=nil) then
1bef0 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 73   \.            s
1bf00 5f 6f 75 74 3d 27 6d 61 74 63 68 27 3b 5c 0a 20  _out='match';\. 
1bf10 20 20 20 20 20 20 20 65 6e 64 3b 5c 0a 20 20 20         end;\.   
1bf20 20 20 20 20 20 70 72 69 6e 74 66 28 73 5f 6f 75       printf(s_ou
1bf30 74 29 3b 5c 0a 20 20 20 20 20 20 20 20 5c 22 20  t);\.        \" 
1bf40 5c 22 24 53 5f 50 41 43 4b 45 54 5f 4e 41 4d 45  \"$S_PACKET_NAME
1bf50 5f 43 41 4e 44 49 44 41 54 45 5c 22 20 60 22 0a  _CANDIDATE\" `".
1bf60 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66      #----.    if
1bf70 20 5b 20 22 24 3f 22 20 21 3d 20 22 30 22 20 5d   [ "$?" != "0" ]
1bf80 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 65  ; then.        e
1bf90 63 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 65  cho "".        e
1bfa0 63 68 6f 20 22 53 6f 6d 65 74 68 69 6e 67 20 77  cho "Something w
1bfb0 65 6e 74 20 77 72 6f 6e 67 2e 20 5c 24 3f 3d 3d  ent wrong. \$?==
1bfc0 24 3f 20 22 0a 20 20 20 20 20 20 20 20 65 63 68  $? ".        ech
1bfd0 6f 20 22 20 20 20 20 53 5f 50 41 43 4b 45 54 5f  o "    S_PACKET_
1bfe0 4e 41 4d 45 5f 43 41 4e 44 49 44 41 54 45 3d 3d  NAME_CANDIDATE==
1bff0 24 53 5f 50 41 43 4b 45 54 5f 4e 41 4d 45 5f 43  $S_PACKET_NAME_C
1c000 41 4e 44 49 44 41 54 45 22 0a 20 20 20 20 20 20  ANDIDATE".      
1c010 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 37    echo "GUID=='7
1c020 61 64 33 38 39 33 65 2d 61 63 30 61 2d 34 65 35  ad3893e-ac0a-4e5
1c030 66 2d 62 32 32 64 2d 38 30 32 30 37 30 65 30 33  f-b22d-802070e03
1c040 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
1c050 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
1c060 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1c070 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1c080 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
1c090 77 69 74 68 20 65 72 72 6f 72 0a 20 20 20 20 66  with error.    f
1c0a0 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a  i.    #--------.
1c0b0 20 20 20 20 23 20 49 66 20 74 68 65 20 66 69 6c      # If the fil
1c0c0 65 20 6e 61 6d 65 20 73 74 61 72 74 73 20 6c 69  e name starts li
1c0d0 6b 65 20 22 2e 2f 66 6f 6f 22 20 69 6e 20 73 74  ke "./foo" in st
1c0e0 65 61 64 20 6f 66 20 22 66 6f 6f 22 2c 20 0a 20  ead of "foo", . 
1c0f0 20 20 20 23 20 74 68 65 6e 20 74 68 65 20 76 65     # then the ve
1c100 72 69 66 69 63 61 74 69 6f 6e 20 61 6c 73 6f 20  rification also 
1c110 66 61 69 6c 73 2c 20 0a 20 20 20 20 23 20 65 78  fails, .    # ex
1c120 61 63 74 6c 79 20 61 73 20 65 78 70 65 63 74 65  actly as expecte
1c130 64 20 61 6e 64 20 64 65 6d 61 6e 64 65 64 20 62  d and demanded b
1c140 79 20 74 68 65 20 73 70 65 63 2e 0a 20 20 20 20  y the spec..    
1c150 69 66 20 5b 20 22 24 53 5f 54 4d 50 5f 30 22 20  if [ "$S_TMP_0" 
1c160 3d 3d 20 22 6d 61 74 63 68 22 20 5d 3b 20 74 68  == "match" ]; th
1c170 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 4f 55 54  en.        S_OUT
1c180 3d 22 76 65 72 69 66 69 63 61 74 69 6f 6e 5f 70  ="verification_p
1c190 61 73 73 65 64 22 20 23 20 6f 70 70 6f 73 69 74  assed" # opposit
1c1a0 65 3a 20 22 76 65 72 69 66 69 63 61 74 69 6f 6e  e: "verification
1c1b0 5f 66 61 69 6c 65 64 22 0a 20 20 20 20 66 69 0a  _failed".    fi.
1c1c0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20      #--------.  
1c1d0 20 20 65 63 68 6f 20 22 24 53 5f 4f 55 54 22 0a    echo "$S_OUT".
1c1e0 7d 20 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69  } # func_mmmv_si
1c1f0 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67  lktorrent_packag
1c200 65 72 5f 74 31 5f 62 61 73 68 5f 76 65 72 69 66  er_t1_bash_verif
1c210 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f  y_packet_name_fo
1c220 72 6d 61 74 5f 76 31 0a 0a 0a 23 2d 2d 2d 2d 2d  rmat_v1...#-----
1c230 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c240 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c250 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c260 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c270 2d 2d 2d 2d 2d 0a 0a 23 20 54 68 65 20 0a 53 5f  -----..# The .S_
1c280 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
1c290 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22  AGER_T1_ACTION="
1c2a0 22 20 23 20 69 73 20 67 6c 6f 62 61 6c 20 74 6f  " # is global to
1c2b0 20 61 6c 6c 6f 77 20 69 74 20 74 6f 20 62 65 20   allow it to be 
1c2c0 75 73 65 64 20 69 6e 20 74 68 65 20 0a 20 20 20  used in the .   
1c2d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c2e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c2f0 20 23 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65   # error message
1c300 73 20 6f 66 20 64 69 66 66 65 72 65 6e 74 20 66  s of different f
1c310 75 6e 63 74 69 6f 6e 73 2e 0a 53 5f 53 49 4c 4b  unctions..S_SILK
1c320 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
1c330 5f 54 31 5f 41 43 54 49 4f 4e 5f 57 41 52 50 5f  _T1_ACTION_WARP_
1c340 4e 52 41 4e 44 3d 22 22 20 0a 0a 23 2d 2d 2d 2d  NRAND="" ..#----
1c350 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c370 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c380 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c390 2d 2d 2d 2d 2d 2d 0a 0a 0a 66 75 6e 63 5f 6d 6d  ------...func_mm
1c3a0 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
1c3b0 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
1c3c0 64 65 74 65 72 6d 69 6e 65 5f 61 63 74 69 6f 6e  determine_action
1c3d0 28 29 20 7b 20 0a 20 20 20 20 6c 6f 63 61 6c 20  () { .    local 
1c3e0 53 5f 41 52 47 56 5f 30 3d 22 24 31 22 20 23 20  S_ARGV_0="$1" # 
1c3f0 52 75 62 79 20 73 74 79 6c 65 20 41 52 47 56 2c  Ruby style ARGV,
1c400 20 30 20 69 73 20 74 68 65 20 66 69 72 73 74 20   0 is the first 
1c410 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 61 72 67  command line arg
1c420 75 6d 65 6e 74 2e 0a 20 20 20 20 6c 6f 63 61 6c  ument..    local
1c430 20 53 5f 41 52 47 56 5f 31 3d 22 24 32 22 20 0a   S_ARGV_1="$2" .
1c440 20 20 20 20 6c 6f 63 61 6c 20 53 5f 41 52 47 56      local S_ARGV
1c450 5f 32 3d 22 24 33 22 20 0a 20 20 20 20 6c 6f 63  _2="$3" .    loc
1c460 61 6c 20 53 5f 41 52 47 56 5f 33 3d 22 24 34 22  al S_ARGV_3="$4"
1c470 20 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 0a   .    #--------.
1c480 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1c490 56 5f 30 22 20 3d 3d 20 22 22 20 5d 3b 20 74 68  V_0" == "" ]; th
1c4a0 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f  en.        func_
1c4b0 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
1c4c0 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
1c4d0 68 5f 70 72 69 6e 74 5f 68 65 6c 70 5f 6d 73 67  h_print_help_msg
1c4e0 5f 74 31 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d  _t1.        #---
1c4f0 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f  -.        cd $S_
1c500 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20  FP_ORIG.        
1c510 65 78 69 74 20 31 20 23 20 65 78 69 74 20 77 69  exit 1 # exit wi
1c520 74 68 20 61 6e 20 65 72 72 6f 72 0a 20 20 20 20  th an error.    
1c530 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20  fi.    #----.   
1c540 20 6c 6f 63 61 6c 20 53 42 5f 30 3d 22 66 22 0a   local SB_0="f".
1c550 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1c560 56 5f 30 22 20 3d 3d 20 22 68 65 6c 70 22 20 5d  V_0" == "help" ]
1c570 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
1c580 42 5f 30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20  B_0="t".    fi. 
1c590 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56     if [ "$S_ARGV
1c5a0 5f 30 22 20 3d 3d 20 22 2d 2d 68 65 6c 70 22 20  _0" == "--help" 
1c5b0 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
1c5c0 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66 69 0a  SB_0="t".    fi.
1c5d0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1c5e0 56 5f 30 22 20 3d 3d 20 22 3f 22 20 5d 3b 20 74  V_0" == "?" ]; t
1c5f0 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30  hen.        SB_0
1c600 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ="t".    fi.    
1c610 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22  if [ "$S_ARGV_0"
1c620 20 3d 3d 20 22 2d 3f 22 20 5d 3b 20 74 68 65 6e   == "-?" ]; then
1c630 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22 74  .        SB_0="t
1c640 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ".    fi.    if 
1c650 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d  [ "$S_ARGV_0" ==
1c660 20 22 68 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20   "h" ]; then.   
1c670 20 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20       SB_0="t".  
1c680 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24    fi.    if [ "$
1c690 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 68  S_ARGV_0" == "-h
1c6a0 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
1c6b0 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66    SB_0="t".    f
1c6c0 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  i.    #----.    
1c6d0 69 66 20 5b 20 22 24 53 42 5f 30 22 20 3d 3d 20  if [ "$SB_0" == 
1c6e0 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "t" ]; then.    
1c6f0 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73      func_mmmv_as
1c700 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73 65  sert_arg_is_abse
1c710 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20 20 20  nt_t1 \.        
1c720 20 20 20 20 20 20 20 20 22 24 53 5f 41 52 47 56          "$S_ARGV
1c730 5f 31 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  _1" \.          
1c740 20 20 20 20 20 20 22 32 2e 20 63 6f 6e 73 6f 6c        "2. consol
1c750 65 20 61 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20  e argument" \.  
1c760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 61                "a
1c770 64 66 35 63 66 32 66 2d 36 66 62 30 2d 34 65 30  df5cf2f-6fb0-4e0
1c780 31 2d 38 33 36 66 2d 38 30 32 30 37 30 65 30 33  1-836f-802070e03
1c790 31 65 37 22 0a 20 20 20 20 20 20 20 20 66 75 6e  1e7".        fun
1c7a0 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65  c_mmmv_silktorre
1c7b0 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62  nt_packager_t1_b
1c7c0 61 73 68 5f 70 72 69 6e 74 5f 68 65 6c 70 5f 6d  ash_print_help_m
1c7d0 73 67 5f 74 31 0a 20 20 20 20 20 20 20 20 23 2d  sg_t1.        #-
1c7e0 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1c7f0 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1c800 20 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20    exit 0 # exit 
1c810 77 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72  without an error
1c820 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1c830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c840 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
1c850 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20   "$S_ARGV_0" == 
1c860 22 76 65 72 73 69 6f 6e 22 20 5d 3b 20 74 68 65  "version" ]; the
1c870 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22  n.        SB_0="
1c880 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  t".    fi.    if
1c890 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d   [ "$S_ARGV_0" =
1c8a0 3d 20 22 2d 2d 76 65 72 73 69 6f 6e 22 20 5d 3b  = "--version" ];
1c8b0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42   then.        SB
1c8c0 5f 30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20  _0="t".    fi.  
1c8d0 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f    if [ "$S_ARGV_
1c8e0 30 22 20 3d 3d 20 22 2d 76 65 72 73 69 6f 6e 22  0" == "-version"
1c8f0 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1c900 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66 69   SB_0="t".    fi
1c910 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52  .    if [ "$S_AR
1c920 47 56 5f 30 22 20 3d 3d 20 22 76 22 20 5d 3b 20  GV_0" == "v" ]; 
1c930 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f  then.        SB_
1c940 30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20  0="t".    fi.   
1c950 20 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30   if [ "$S_ARGV_0
1c960 22 20 3d 3d 20 22 2d 76 22 20 5d 3b 20 74 68 65  " == "-v" ]; the
1c970 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22  n.        SB_0="
1c980 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d  t".    fi.    #-
1c990 2d 2d 2d 0a 20 20 20 20 69 66 20 5b 20 22 24 53  ---.    if [ "$S
1c9a0 42 5f 30 22 20 3d 3d 20 22 74 22 20 5d 3b 20 74  B_0" == "t" ]; t
1c9b0 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75 6e 63  hen.        func
1c9c0 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72 67  _mmmv_assert_arg
1c9d0 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20 5c 0a  _is_absent_t1 \.
1c9e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1c9f0 22 24 53 5f 41 52 47 56 5f 31 22 20 5c 0a 20 20  "$S_ARGV_1" \.  
1ca00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 32                "2
1ca10 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
1ca20 6e 74 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  nt" \.          
1ca30 20 20 20 20 20 20 22 35 34 36 61 36 34 63 32 2d        "546a64c2-
1ca40 39 36 66 65 2d 34 31 66 61 2d 38 63 36 66 2d 38  96fe-41fa-8c6f-8
1ca50 30 32 30 37 30 65 30 33 31 65 37 22 0a 20 20 20  02070e031e7".   
1ca60 20 20 20 20 20 65 63 68 6f 20 22 24 53 5f 53 43       echo "$S_SC
1ca70 52 49 50 54 5f 56 45 52 53 49 4f 4e 22 0a 20 20  RIPT_VERSION".  
1ca80 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1ca90 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1caa0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30  G.        exit 0
1cab0 20 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20   # exit without 
1cac0 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1cad0 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d      #-----------
1cae0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
1caf0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1cb00 56 5f 30 22 20 3d 3d 20 22 76 65 72 73 69 6f 6e  V_0" == "version
1cb10 5f 74 69 6d 65 73 74 61 6d 70 22 20 5d 3b 20 74  _timestamp" ]; t
1cb20 68 65 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30  hen.        SB_0
1cb30 3d 22 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20  ="t".    fi.    
1cb40 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22  if [ "$S_ARGV_0"
1cb50 20 3d 3d 20 22 2d 2d 76 65 72 73 69 6f 6e 5f 74   == "--version_t
1cb60 69 6d 65 73 74 61 6d 70 22 20 5d 3b 20 74 68 65  imestamp" ]; the
1cb70 6e 0a 20 20 20 20 20 20 20 20 53 42 5f 30 3d 22  n.        SB_0="
1cb80 74 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66  t".    fi.    if
1cb90 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d   [ "$S_ARGV_0" =
1cba0 3d 20 22 2d 76 65 72 73 69 6f 6e 5f 74 69 6d 65  = "-version_time
1cbb0 73 74 61 6d 70 22 20 5d 3b 20 74 68 65 6e 0a 20  stamp" ]; then. 
1cbc0 20 20 20 20 20 20 20 53 42 5f 30 3d 22 74 22 0a         SB_0="t".
1cbd0 20 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20      fi.    if [ 
1cbe0 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22  "$S_ARGV_0" == "
1cbf0 76 74 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  vt" ]; then.    
1cc00 20 20 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20      SB_0="t".   
1cc10 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53   fi.    if [ "$S
1cc20 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 76 74  _ARGV_0" == "-vt
1cc30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20  " ]; then.      
1cc40 20 20 53 42 5f 30 3d 22 74 22 0a 20 20 20 20 66    SB_0="t".    f
1cc50 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20  i.    #----.    
1cc60 69 66 20 5b 20 22 24 53 42 5f 30 22 20 3d 3d 20  if [ "$SB_0" == 
1cc70 22 74 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  "t" ]; then.    
1cc80 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73      func_mmmv_as
1cc90 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73 65  sert_arg_is_abse
1cca0 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20 20 20  nt_t1 \.        
1ccb0 20 20 20 20 20 20 20 20 22 24 53 5f 41 52 47 56          "$S_ARGV
1ccc0 5f 31 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  _1" \.          
1ccd0 20 20 20 20 20 20 22 32 2e 20 63 6f 6e 73 6f 6c        "2. consol
1cce0 65 20 61 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20  e argument" \.  
1ccf0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 33                "3
1cd00 39 64 65 32 31 39 31 2d 65 64 63 30 2d 34 65 32  9de2191-edc0-4e2
1cd10 61 2d 62 32 36 66 2d 38 30 32 30 37 30 65 30 33  a-b26f-802070e03
1cd20 31 65 37 22 0a 20 20 20 20 20 20 20 20 65 63 68  1e7".        ech
1cd30 6f 20 22 24 53 5f 53 43 52 49 50 54 5f 56 45 52  o "$S_SCRIPT_VER
1cd40 53 49 4f 4e 5f 47 45 4e 45 52 41 54 49 4f 4e 5f  SION_GENERATION_
1cd50 44 41 54 45 22 0a 20 20 20 20 20 20 20 20 23 2d  DATE".        #-
1cd60 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1cd70 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1cd80 20 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20    exit 0 # exit 
1cd90 77 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72  without an error
1cda0 0a 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d  .    fi.    #---
1cdb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cdc0 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 53 74  -------.    # St
1cdd0 61 72 74 20 6f 66 20 61 63 74 69 6f 6e 73 20 74  art of actions t
1cde0 68 61 74 20 72 65 71 75 69 72 65 20 74 68 65 20  hat require the 
1cdf0 65 78 69 73 74 65 6e 63 65 20 6f 66 20 61 74 20  existence of at 
1ce00 6c 65 61 73 74 20 6f 6e 65 20 66 69 6c 65 2e 0a  least one file..
1ce10 20 20 20 20 6c 6f 63 61 6c 20 53 42 5f 46 49 4c      local SB_FIL
1ce20 45 5f 52 45 51 55 49 52 45 44 3d 22 74 22 0a 20  E_REQUIRED="t". 
1ce30 20 20 20 6c 6f 63 61 6c 20 53 42 5f 52 45 51 55     local SB_REQU
1ce40 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58 49  ESTED_ACTION_EXI
1ce50 53 54 53 3d 22 66 22 0a 20 20 20 20 6c 6f 63 61  STS="f".    loca
1ce60 6c 20 53 5f 54 4d 50 5f 30 3d 22 22 0a 20 20 20  l S_TMP_0="".   
1ce70 20 6c 6f 63 61 6c 20 53 5f 54 4d 50 5f 31 3d 22   local S_TMP_1="
1ce80 22 0a 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52  ".    S_SILKTORR
1ce90 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
1cea0 41 43 54 49 4f 4e 5f 57 41 52 50 5f 4e 52 41 4e  ACTION_WARP_NRAN
1ceb0 44 3d 22 22 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20  D="".    #----. 
1cec0 20 20 20 53 5f 54 4d 50 5f 30 3d 22 77 72 61 70     S_TMP_0="wrap
1ced0 22 20 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  " .    if [ "$S_
1cee0 41 52 47 56 5f 30 22 20 3d 3d 20 22 24 53 5f 54  ARGV_0" == "$S_T
1cef0 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20  MP_0" ]; then.  
1cf00 20 20 20 20 20 20 53 5f 53 49 4c 4b 54 4f 52 52        S_SILKTORR
1cf10 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f  ENT_PACKAGER_T1_
1cf20 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d 50 5f 30  ACTION="$S_TMP_0
1cf30 22 0a 20 20 20 20 20 20 20 20 53 42 5f 52 45 51  ".        SB_REQ
1cf40 55 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f 45 58  UESTED_ACTION_EX
1cf50 49 53 54 53 3d 22 74 22 0a 20 20 20 20 66 69 0a  ISTS="t".    fi.
1cf60 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1cf70 56 5f 30 22 20 3d 3d 20 22 70 61 63 6b 22 20 5d  V_0" == "pack" ]
1cf80 3b 20 74 68 65 6e 20 20 20 23 20 61 6c 69 61 73  ; then   # alias
1cf90 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54  .        S_SILKT
1cfa0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1cfb0 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d  T1_ACTION="$S_TM
1cfc0 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42 5f  P_0".        SB_
1cfd0 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e  REQUESTED_ACTION
1cfe0 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20 20  _EXISTS="t".    
1cff0 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1d000 41 52 47 56 5f 30 22 20 3d 3d 20 22 77 22 20 5d  ARGV_0" == "w" ]
1d010 3b 20 74 68 65 6e 20 20 20 23 20 61 6c 69 61 73  ; then   # alias
1d020 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54  .        S_SILKT
1d030 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1d040 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d  T1_ACTION="$S_TM
1d050 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42 5f  P_0".        SB_
1d060 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e  REQUESTED_ACTION
1d070 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20 20  _EXISTS="t".    
1d080 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1d090 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 77 22 20  ARGV_0" == "-w" 
1d0a0 5d 3b 20 74 68 65 6e 20 20 20 23 20 61 6c 69 61  ]; then   # alia
1d0b0 73 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b  s.        S_SILK
1d0c0 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
1d0d0 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54  _T1_ACTION="$S_T
1d0e0 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42  MP_0".        SB
1d0f0 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f  _REQUESTED_ACTIO
1d100 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20  N_EXISTS="t".   
1d110 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53   fi.    if [ "$S
1d120 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1d130 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22  KAGER_T1_ACTION"
1d140 20 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d   == "$S_TMP_0" ]
1d150 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 69  ; then.        i
1d160 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 32 22 20  f [ "$S_ARGV_2" 
1d170 21 3d 20 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20  != "" ]; then.  
1d180 20 20 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d            func_m
1d190 6d 6d 76 5f 78 5f 70 6f 73 69 74 69 76 65 5f 77  mmv_x_positive_w
1d1a0 68 6f 6c 65 5f 6e 75 6d 62 65 72 5f 6f 72 5f 61  hole_number_or_a
1d1b0 6e 5f 65 6d 70 74 79 73 74 72 69 6e 67 5f 74 31  n_emptystring_t1
1d1c0 20 22 24 53 5f 41 52 47 56 5f 32 22 0a 20 20 20   "$S_ARGV_2".   
1d1d0 20 20 20 20 20 20 20 20 20 53 5f 54 4d 50 5f 31           S_TMP_1
1d1e0 3d 22 24 53 5f 46 55 4e 43 5f 4d 4d 4d 56 5f 58  ="$S_FUNC_MMMV_X
1d1f0 5f 50 4f 53 49 54 49 56 45 5f 57 48 4f 4c 45 5f  _POSITIVE_WHOLE_
1d200 4e 55 4d 42 45 52 5f 4f 52 5f 41 4e 5f 45 4d 50  NUMBER_OR_AN_EMP
1d210 54 59 53 54 52 49 4e 47 5f 54 31 5f 4f 55 54 22  TYSTRING_T1_OUT"
1d220 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20  .            if 
1d230 5b 20 22 24 53 5f 54 4d 50 5f 31 22 20 3d 3d 20  [ "$S_TMP_1" == 
1d240 22 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  "" ]; then.     
1d250 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1d260 22 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  "".             
1d270 20 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20     echo "".     
1d280 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20             echo 
1d290 22 54 68 65 20 4e 5f 4f 46 5f 52 41 4e 44 4f 4d  "The N_OF_RANDOM
1d2a0 5f 54 45 58 54 5f 42 4c 4f 43 4b 53 28 3d 3d 24  _TEXT_BLOCKS(==$
1d2b0 53 5f 41 52 47 56 5f 32 29 20 69 73 20 65 78 70  S_ARGV_2) is exp
1d2c0 65 63 74 65 64 20 22 0a 20 20 20 20 20 20 20 20  ected ".        
1d2d0 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 74 6f          echo "to
1d2e0 20 62 65 20 61 20 70 6f 73 69 74 69 76 65 20 77   be a positive w
1d2f0 68 6f 6c 65 20 6e 75 6d 62 65 72 2e 22 0a 20 20  hole number.".  
1d300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63                ec
1d310 68 6f 20 22 47 55 49 44 3d 3d 27 33 65 31 65 30  ho "GUID=='3e1e0
1d320 38 34 33 2d 39 65 62 31 2d 34 34 63 65 2d 61 35  843-9eb1-44ce-a5
1d330 31 64 2d 38 30 32 30 37 30 65 30 33 31 65 37 27  1d-802070e031e7'
1d340 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ".              
1d350 20 20 65 63 68 6f 20 22 22 0a 20 20 20 20 20 20    echo "".      
1d360 20 20 20 20 20 20 20 20 20 20 23 20 66 75 6e 63            # func
1d370 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e  _mmmv_silktorren
1d380 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61  t_packager_t1_ba
1d390 73 68 5f 70 72 69 6e 74 5f 68 65 6c 70 5f 6d 73  sh_print_help_ms
1d3a0 67 5f 74 31 0a 20 20 20 20 20 20 20 20 20 20 20  g_t1.           
1d3b0 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20       #----.     
1d3c0 20 20 20 20 20 20 20 20 20 20 20 63 64 20 24 53             cd $S
1d3d0 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
1d3e0 20 20 20 20 20 20 20 20 20 65 78 69 74 20 31 20           exit 1 
1d3f0 23 20 65 78 69 74 20 77 69 74 68 20 61 6e 20 65  # exit with an e
1d400 72 72 6f 72 0a 20 20 20 20 20 20 20 20 20 20 20  rror.           
1d410 20 66 69 0a 20 20 20 20 20 20 20 20 20 20 20 20   fi.            
1d420 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
1d430 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20  ----------.     
1d440 20 20 20 20 20 20 20 23 20 53 65 74 73 20 61 20         # Sets a 
1d450 6c 69 6d 69 74 20 74 68 61 74 20 66 69 6c 65 73  limit that files
1d460 20 74 68 61 74 20 0a 20 20 20 20 20 20 20 20 20   that .         
1d470 20 20 20 23 20 68 61 76 65 20 73 70 61 63 65 73     # have spaces
1d480 20 61 6e 64 20 74 61 62 73 20 69 6e 20 74 68 65   and tabs in the
1d490 69 72 20 6e 61 6d 65 73 20 63 61 6e 20 6e 6f 74  ir names can not
1d4a0 20 62 65 20 70 61 63 6b 65 64 0a 20 20 20 20 20   be packed.     
1d4b0 20 20 20 20 20 20 20 23 20 77 69 74 68 6f 75 74         # without
1d4c0 20 72 65 6e 61 6d 69 6e 67 20 6f 72 20 77 72 61   renaming or wra
1d4d0 70 70 69 6e 67 20 74 68 65 6d 20 74 6f 20 73 6f  pping them to so
1d4e0 6d 65 20 74 61 72 2d 66 69 6c 65 20 74 68 61 74  me tar-file that
1d4f0 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20   .            # 
1d500 68 61 73 20 61 20 73 70 61 63 65 2d 74 61 62 2d  has a space-tab-
1d510 6c 69 6e 65 62 72 65 61 6b 2d 66 72 65 65 20 6e  linebreak-free n
1d520 61 6d 65 2e 0a 20 20 20 20 20 20 20 20 20 20 20  ame..           
1d530 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73 73 65 72   func_mmmv_asser
1d540 74 5f 61 72 67 5f 69 73 5f 61 62 73 65 6e 74 5f  t_arg_is_absent_
1d550 74 31 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20  t1 \.           
1d560 20 20 20 20 20 20 20 20 20 22 24 53 5f 41 52 47           "$S_ARG
1d570 56 5f 33 22 20 5c 0a 20 20 20 20 20 20 20 20 20  V_3" \.         
1d580 20 20 20 20 20 20 20 20 20 20 20 22 34 2e 20 63             "4. c
1d590 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65 6e 74 22  onsole argument"
1d5a0 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20   \.             
1d5b0 20 20 20 20 20 20 20 22 31 33 35 37 33 30 32 62         "1357302b
1d5c0 2d 63 30 65 32 2d 34 39 35 31 2d 38 33 35 66 2d  -c0e2-4951-835f-
1d5d0 38 30 32 30 37 30 65 30 33 31 65 37 22 0a 20 20  802070e031e7".  
1d5e0 20 20 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d 2d            #-----
1d5f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d600 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 20 20 20  ----.           
1d610 20 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50   S_SILKTORRENT_P
1d620 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1d630 4e 5f 57 41 52 50 5f 4e 52 41 4e 44 3d 22 24 53  N_WARP_NRAND="$S
1d640 5f 54 4d 50 5f 31 22 20 23 20 3d 3d 4e 5f 4f 46  _TMP_1" # ==N_OF
1d650 5f 52 41 4e 44 4f 4d 5f 54 45 58 54 5f 42 4c 4f  _RANDOM_TEXT_BLO
1d660 43 4b 53 0a 20 20 20 20 20 20 20 20 66 69 0a 20  CKS.        fi. 
1d670 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a     fi.    #----.
1d680 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 75 6e 77      S_TMP_0="unw
1d690 72 61 70 22 20 0a 20 20 20 20 69 66 20 5b 20 22  rap" .    if [ "
1d6a0 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 24  $S_ARGV_0" == "$
1d6b0 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e  S_TMP_0" ]; then
1d6c0 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54  .        S_SILKT
1d6d0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1d6e0 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d  T1_ACTION="$S_TM
1d6f0 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42 5f  P_0".        SB_
1d700 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e  REQUESTED_ACTION
1d710 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20 20  _EXISTS="t".    
1d720 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1d730 41 52 47 56 5f 30 22 20 3d 3d 20 22 75 6e 70 61  ARGV_0" == "unpa
1d740 63 6b 22 20 5d 3b 20 74 68 65 6e 20 23 20 61 6c  ck" ]; then # al
1d750 69 61 73 0a 20 20 20 20 20 20 20 20 53 5f 53 49  ias.        S_SI
1d760 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
1d770 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53  ER_T1_ACTION="$S
1d780 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
1d790 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54  SB_REQUESTED_ACT
1d7a0 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20  ION_EXISTS="t". 
1d7b0 20 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22     fi.    if [ "
1d7c0 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 75  $S_ARGV_0" == "u
1d7d0 77 22 20 5d 3b 20 74 68 65 6e 20 23 20 61 6c 69  w" ]; then # ali
1d7e0 61 73 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c  as.        S_SIL
1d7f0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
1d800 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f  R_T1_ACTION="$S_
1d810 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53  TMP_0".        S
1d820 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54 49  B_REQUESTED_ACTI
1d830 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20  ON_EXISTS="t".  
1d840 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24    fi.    if [ "$
1d850 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 75  S_ARGV_0" == "-u
1d860 77 22 20 5d 3b 20 74 68 65 6e 20 23 20 61 6c 69  w" ]; then # ali
1d870 61 73 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c  as.        S_SIL
1d880 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
1d890 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f  R_T1_ACTION="$S_
1d8a0 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53  TMP_0".        S
1d8b0 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54 49  B_REQUESTED_ACTI
1d8c0 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20  ON_EXISTS="t".  
1d8d0 20 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24    fi.    if [ "$
1d8e0 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41  S_SILKTORRENT_PA
1d8f0 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e  CKAGER_T1_ACTION
1d900 22 20 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20  " == "$S_TMP_0" 
1d910 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20  ]; then.        
1d920 23 20 41 20 6d 6f 72 65 20 73 74 72 65 69 67 68  # A more streigh
1d930 74 66 6f 72 77 61 72 64 20 63 68 65 63 6b 20 77  tforward check w
1d940 6f 75 6c 64 20 62 65 3a 0a 20 20 20 20 20 20 20  ould be:.       
1d950 20 23 0a 20 20 20 20 20 20 20 20 23 20 66 75 6e   #.        # fun
1d960 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61 72  c_mmmv_assert_ar
1d970 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20 5c  g_is_absent_t1 \
1d980 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20  .        #      
1d990 20 20 20 22 24 53 5f 41 52 47 56 5f 33 22 20 5c     "$S_ARGV_3" \
1d9a0 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20  .        #      
1d9b0 20 20 20 22 34 2e 20 63 6f 6e 73 6f 6c 65 20 61     "4. console a
1d9c0 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20 20 20 20  rgument" \.     
1d9d0 20 20 20 23 20 20 20 20 20 20 20 20 20 22 63 65     #         "ce
1d9e0 66 62 32 39 32 65 2d 35 63 35 30 2d 34 66 30 30  fb292e-5c50-4f00
1d9f0 2d 62 34 35 66 2d 38 30 32 30 37 30 65 30 33 31  -b45f-802070e031
1da00 65 37 22 0a 20 20 20 20 20 20 20 20 23 0a 20 20  e7".        #.  
1da10 20 20 20 20 20 20 23 20 62 75 74 20 69 6e 20 74        # but in t
1da20 68 65 20 63 61 73 65 20 6f 66 20 74 68 65 20 75  he case of the u
1da30 6e 77 72 61 70 20 63 6f 6d 6d 61 6e 64 20 74 68  nwrap command th
1da40 65 20 68 61 63 6b 20 69 6e 20 74 68 69 73 20 69  e hack in this i
1da50 66 2d 63 6c 61 75 73 65 0a 20 20 20 20 20 20 20  f-clause.       
1da60 20 23 20 67 69 76 65 73 20 61 20 6d 6f 72 65 20   # gives a more 
1da70 69 6e 66 6f 72 6d 61 74 69 76 65 20 65 72 72 6f  informative erro
1da80 72 20 6d 65 73 73 61 67 65 20 66 6f 72 20 0a 20  r message for . 
1da90 20 20 20 20 20 20 20 23 20 53 69 6c 6b 74 6f 72         # Silktor
1daa0 72 65 6e 74 20 70 61 63 6b 65 74 20 63 61 6e 64  rent packet cand
1dab0 69 64 61 74 65 20 66 69 6c 65 73 20 74 68 61 74  idate files that
1dac0 20 68 61 76 65 20 73 70 61 63 65 73 20 69 6e 20   have spaces in 
1dad0 74 68 65 69 72 20 6e 61 6d 65 20 0a 20 20 20 20  their name .    
1dae0 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52 47      if [ "$S_ARG
1daf0 56 5f 32 22 20 21 3d 20 22 22 20 5d 3b 20 74 68  V_2" != "" ]; th
1db00 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 53  en.            S
1db10 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1db20 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d  KAGER_T1_ACTION=
1db30 22 76 65 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e  "verify_packet_n
1db40 61 6d 65 5f 66 6f 72 6d 61 74 5f 76 31 22 0a 20  ame_format_v1". 
1db50 20 20 20 20 20 20 20 66 69 0a 20 20 20 20 66 69         fi.    fi
1db60 0a 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 53  .    #----.    S
1db70 5f 54 4d 50 5f 30 3d 22 76 65 72 69 66 79 22 20  _TMP_0="verify" 
1db80 23 20 63 68 65 63 6b 73 20 74 68 65 20 6d 61 74  # checks the mat
1db90 63 68 20 62 65 74 77 65 65 6e 20 74 68 65 20 62  ch between the b
1dba0 6c 6f 62 20 61 6e 64 20 74 68 65 20 66 69 6c 65  lob and the file
1dbb0 20 6e 61 6d 65 0a 20 20 20 20 69 66 20 5b 20 22   name.    if [ "
1dbc0 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 24  $S_ARGV_0" == "$
1dbd0 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74 68 65 6e  S_TMP_0" ]; then
1dbe0 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b 54  .        S_SILKT
1dbf0 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52 5f  ORRENT_PACKAGER_
1dc00 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54 4d  T1_ACTION="$S_TM
1dc10 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42 5f  P_0".        SB_
1dc20 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e  REQUESTED_ACTION
1dc30 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20 20  _EXISTS="t".    
1dc40 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1dc50 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
1dc60 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 22 20  AGER_T1_ACTION" 
1dc70 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b  == "$S_TMP_0" ];
1dc80 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75   then.        fu
1dc90 6e 63 5f 6d 6d 6d 76 5f 61 73 73 65 72 74 5f 61  nc_mmmv_assert_a
1dca0 72 67 5f 69 73 5f 61 62 73 65 6e 74 5f 74 31 20  rg_is_absent_t1 
1dcb0 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  \.              
1dcc0 20 20 22 24 53 5f 41 52 47 56 5f 32 22 20 5c 0a    "$S_ARGV_2" \.
1dcd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1dce0 22 33 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75  "3. console argu
1dcf0 6d 65 6e 74 22 20 5c 0a 20 20 20 20 20 20 20 20  ment" \.        
1dd00 20 20 20 20 20 20 20 20 22 32 33 30 36 39 31 31          "2306911
1dd10 34 2d 33 65 38 38 2d 34 30 63 61 2d 62 35 35 66  4-3e88-40ca-b55f
1dd20 2d 38 30 32 30 37 30 65 30 33 31 65 37 22 0a 20  -802070e031e7". 
1dd30 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 0a     fi.    #----.
1dd40 20 20 20 20 53 5f 54 4d 50 5f 30 3d 22 74 65 73      S_TMP_0="tes
1dd50 74 5f 68 61 73 68 5f 74 31 22 20 0a 20 20 20 20  t_hash_t1" .    
1dd60 69 66 20 5b 20 22 24 53 5f 41 52 47 56 5f 30 22  if [ "$S_ARGV_0"
1dd70 20 3d 3d 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d   == "$S_TMP_0" ]
1dd80 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 53  ; then.        S
1dd90 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43  _SILKTORRENT_PAC
1dda0 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d  KAGER_T1_ACTION=
1ddb0 22 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20  "$S_TMP_0".     
1ddc0 20 20 20 53 42 5f 52 45 51 55 45 53 54 45 44 5f     SB_REQUESTED_
1ddd0 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74  ACTION_EXISTS="t
1dde0 22 0a 20 20 20 20 66 69 0a 20 20 20 20 69 66 20  ".    fi.    if 
1ddf0 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52 45 4e  [ "$S_SILKTORREN
1de00 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43  T_PACKAGER_T1_AC
1de10 54 49 4f 4e 22 20 3d 3d 20 22 24 53 5f 54 4d 50  TION" == "$S_TMP
1de20 5f 30 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20  _0" ]; then.    
1de30 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 61 73      func_mmmv_as
1de40 73 65 72 74 5f 61 72 67 5f 69 73 5f 61 62 73 65  sert_arg_is_abse
1de50 6e 74 5f 74 31 20 5c 0a 20 20 20 20 20 20 20 20  nt_t1 \.        
1de60 20 20 20 20 20 20 20 20 22 24 53 5f 41 52 47 56          "$S_ARGV
1de70 5f 32 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  _2" \.          
1de80 20 20 20 20 20 20 22 33 2e 20 63 6f 6e 73 6f 6c        "3. consol
1de90 65 20 61 72 67 75 6d 65 6e 74 22 20 5c 0a 20 20  e argument" \.  
1dea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 66                "f
1deb0 34 30 38 31 66 61 35 2d 30 36 63 61 2d 34 34 30  4081fa5-06ca-440
1dec0 64 2d 39 31 35 66 2d 38 30 32 30 37 30 65 30 33  d-915f-802070e03
1ded0 31 65 37 22 0a 20 20 20 20 66 69 0a 20 20 20 20  1e7".    fi.    
1dee0 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20  #--------.    # 
1def0 53 74 61 72 74 20 6f 66 20 61 63 74 69 6f 6e 73  Start of actions
1df00 20 74 68 61 74 20 64 6f 20 6e 6f 74 20 72 65 71   that do not req
1df10 75 69 72 65 20 61 20 66 69 6c 65 3a 0a 20 20 20  uire a file:.   
1df20 20 53 5f 54 4d 50 5f 30 3d 22 76 65 72 69 66 79   S_TMP_0="verify
1df30 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72  _packet_name_for
1df40 6d 61 74 5f 76 31 22 20 0a 20 20 20 20 69 66 20  mat_v1" .    if 
1df50 5b 20 22 24 53 5f 41 52 47 56 5f 30 22 20 3d 3d  [ "$S_ARGV_0" ==
1df60 20 22 24 53 5f 54 4d 50 5f 30 22 20 5d 3b 20 74   "$S_TMP_0" ]; t
1df70 68 65 6e 0a 20 20 20 20 20 20 20 20 53 5f 53 49  hen.        S_SI
1df80 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
1df90 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53  ER_T1_ACTION="$S
1dfa0 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
1dfb0 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54  SB_REQUESTED_ACT
1dfc0 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20  ION_EXISTS="t". 
1dfd0 20 20 20 20 20 20 20 53 42 5f 46 49 4c 45 5f 52         SB_FILE_R
1dfe0 45 51 55 49 52 45 44 3d 22 66 22 0a 20 20 20 20  EQUIRED="f".    
1dff0 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1e000 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 2d 76 65  ARGV_0" == "--ve
1e010 72 69 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65  rify_packet_name
1e020 5f 66 6f 72 6d 61 74 5f 76 31 22 20 5d 3b 20 74  _format_v1" ]; t
1e030 68 65 6e 20 0a 20 20 20 20 20 20 20 20 53 5f 53  hen .        S_S
1e040 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41  ILKTORRENT_PACKA
1e050 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24  GER_T1_ACTION="$
1e060 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20  S_TMP_0".       
1e070 20 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43   SB_REQUESTED_AC
1e080 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a  TION_EXISTS="t".
1e090 20 20 20 20 20 20 20 20 53 42 5f 46 49 4c 45 5f          SB_FILE_
1e0a0 52 45 51 55 49 52 45 44 3d 22 66 22 0a 20 20 20  REQUIRED="f".   
1e0b0 20 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53   fi.    if [ "$S
1e0c0 5f 41 52 47 56 5f 30 22 20 3d 3d 20 22 76 65 72  _ARGV_0" == "ver
1e0d0 69 66 79 5f 70 61 63 6b 61 67 65 5f 6e 61 6d 65  ify_package_name
1e0e0 5f 66 6f 72 6d 61 74 5f 76 31 22 20 5d 3b 20 74  _format_v1" ]; t
1e0f0 68 65 6e 20 0a 20 20 20 20 20 20 20 20 23 20 20  hen .        #  
1e100 64 69 66 66 65 72 73 20 66 72 6f 6d 20 24 53 5f  differs from $S_
1e110 54 4d 50 5f 30 20 61 74 20 41 41 41 0a 20 20 20  TMP_0 at AAA.   
1e120 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d       #----------
1e130 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e140 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e150 2d 2d 2d 2d 2d 2d 20 20 20 20 20 20 20 20 20 20  ------          
1e160 20 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c 4b   .        S_SILK
1e170 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45 52  TORRENT_PACKAGER
1e180 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f 54  _T1_ACTION="$S_T
1e190 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53 42  MP_0".        SB
1e1a0 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f  _REQUESTED_ACTIO
1e1b0 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20 20  N_EXISTS="t".   
1e1c0 20 20 20 20 20 53 42 5f 46 49 4c 45 5f 52 45 51       SB_FILE_REQ
1e1d0 55 49 52 45 44 3d 22 66 22 0a 20 20 20 20 66 69  UIRED="f".    fi
1e1e0 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41 52  .    if [ "$S_AR
1e1f0 47 56 5f 30 22 20 3d 3d 20 22 2d 2d 76 65 72 69  GV_0" == "--veri
1e200 66 79 5f 70 61 63 6b 61 67 65 5f 6e 61 6d 65 5f  fy_package_name_
1e210 66 6f 72 6d 61 74 5f 76 31 22 20 5d 3b 20 74 68  format_v1" ]; th
1e220 65 6e 20 0a 20 20 20 20 20 20 20 20 23 20 20 20  en .        #   
1e230 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 24 53   differs from $S
1e240 5f 54 4d 50 5f 30 20 61 74 20 41 41 41 0a 20 20  _TMP_0 at AAA.  
1e250 20 20 20 20 20 20 23 2d 2d 2d 2d 2d 2d 2d 2d 2d        #---------
1e260 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e280 2d 2d 2d 2d 2d 2d 2d 20 20 20 20 20 20 20 20 20  -------         
1e290 20 20 0a 20 20 20 20 20 20 20 20 53 5f 53 49 4c    .        S_SIL
1e2a0 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47 45  KTORRENT_PACKAGE
1e2b0 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53 5f  R_T1_ACTION="$S_
1e2c0 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20 53  TMP_0".        S
1e2d0 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54 49  B_REQUESTED_ACTI
1e2e0 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20 20  ON_EXISTS="t".  
1e2f0 20 20 20 20 20 20 53 42 5f 46 49 4c 45 5f 52 45        SB_FILE_RE
1e300 51 55 49 52 45 44 3d 22 66 22 0a 20 20 20 20 66  QUIRED="f".    f
1e310 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f 41  i.    if [ "$S_A
1e320 52 47 56 5f 30 22 20 3d 3d 20 22 76 6e 66 31 22  RGV_0" == "vnf1"
1e330 20 5d 3b 20 74 68 65 6e 20 20 23 20 61 62 62 72   ]; then  # abbr
1e340 65 76 69 61 74 69 6f 6e 20 6f 66 20 22 76 65 72  eviation of "ver
1e350 69 66 79 20 6e 61 6d 65 20 66 6f 72 6d 61 74 20  ify name format 
1e360 76 31 22 0a 20 20 20 20 20 20 20 20 53 5f 53 49  v1".        S_SI
1e370 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b 41 47  LKTORRENT_PACKAG
1e380 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22 24 53  ER_T1_ACTION="$S
1e390 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20 20 20  _TMP_0".        
1e3a0 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41 43 54  SB_REQUESTED_ACT
1e3b0 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22 0a 20  ION_EXISTS="t". 
1e3c0 20 20 20 20 20 20 20 53 42 5f 46 49 4c 45 5f 52         SB_FILE_R
1e3d0 45 51 55 49 52 45 44 3d 22 66 22 0a 20 20 20 20  EQUIRED="f".    
1e3e0 66 69 0a 20 20 20 20 69 66 20 5b 20 22 24 53 5f  fi.    if [ "$S_
1e3f0 41 52 47 56 5f 30 22 20 3d 3d 20 22 2d 76 6e 66  ARGV_0" == "-vnf
1e400 31 22 20 5d 3b 20 74 68 65 6e 20 20 23 20 61 62  1" ]; then  # ab
1e410 62 72 65 76 69 61 74 69 6f 6e 20 6f 66 20 22 76  breviation of "v
1e420 65 72 69 66 79 20 6e 61 6d 65 20 66 6f 72 6d 61  erify name forma
1e430 74 20 76 31 22 0a 20 20 20 20 20 20 20 20 53 5f  t v1".        S_
1e440 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50 41 43 4b  SILKTORRENT_PACK
1e450 41 47 45 52 5f 54 31 5f 41 43 54 49 4f 4e 3d 22  AGER_T1_ACTION="
1e460 24 53 5f 54 4d 50 5f 30 22 0a 20 20 20 20 20 20  $S_TMP_0".      
1e470 20 20 53 42 5f 52 45 51 55 45 53 54 45 44 5f 41    SB_REQUESTED_A
1e480 43 54 49 4f 4e 5f 45 58 49 53 54 53 3d 22 74 22  CTION_EXISTS="t"
1e490 0a 20 20 20 20 20 20 20 20 53 42 5f 46 49 4c 45  .        SB_FILE
1e4a0 5f 52 45 51 55 49 52 45 44 3d 22 66 22 0a 20 20  _REQUIRED="f".  
1e4b0 20 20 66 69 0a 20 20 20 20 23 20 54 68 65 20 33    fi.    # The 3
1e4c0 2e 20 63 6f 6e 73 6f 6c 65 20 61 72 67 75 6d 65  . console argume
1e4d0 6e 74 20 70 72 65 73 65 6e 63 65 2f 61 62 73 65  nt presence/abse
1e4e0 6e 63 65 20 63 68 65 63 6b 20 6d 75 73 74 20 62  nce check must b
1e4f0 65 0a 20 20 20 20 23 20 69 6e 74 65 6e 74 69 6f  e.    # intentio
1e500 6e 61 6c 6c 79 20 73 6b 69 70 70 65 64 20 66 6f  nally skipped fo
1e510 72 20 74 68 65 20 22 76 65 72 69 66 79 5f 70 61  r the "verify_pa
1e520 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74  cket_name_format
1e530 5f 76 31 22 2c 20 62 65 63 61 75 73 65 20 0a 20  _v1", because . 
1e540 20 20 20 23 20 74 68 65 20 63 6f 6e 73 6f 6c 65     # the console
1e550 20 6f 75 74 70 75 74 20 6d 75 73 74 20 72 65 74   output must ret
1e560 75 72 6e 20 61 20 73 70 65 63 69 66 69 63 20 73  urn a specific s
1e570 74 72 69 6e 67 20 69 6e 20 74 68 65 20 63 61 73  tring in the cas
1e580 65 20 6f 66 20 0a 20 20 20 20 23 20 61 20 70 61  e of .    # a pa
1e590 63 6b 65 74 20 6e 61 6d 65 20 66 6f 72 6d 61 74  cket name format
1e5a0 20 76 65 72 69 66 69 63 61 74 69 6f 6e 20 66 61   verification fa
1e5b0 69 6c 75 72 65 20 61 6e 64 20 61 6e 79 20 73 74  ilure and any st
1e5c0 72 69 6e 67 2c 20 0a 20 20 20 20 23 20 69 6e 63  ring, .    # inc
1e5d0 6c 75 64 69 6e 67 20 74 68 65 20 73 74 72 69 6e  luding the strin
1e5e0 67 73 20 74 68 61 74 20 69 6e 63 6c 75 64 65 20  gs that include 
1e5f0 73 70 61 63 65 73 2c 20 6d 75 73 74 20 62 65 20  spaces, must be 
1e600 61 6c 6c 6f 77 65 64 20 74 6f 20 62 65 20 76 65  allowed to be ve
1e610 72 69 66 69 65 64 2e 0a 20 20 20 20 23 20 0a 20  rified..    # . 
1e620 20 20 20 23 20 41 20 74 68 69 6e 67 20 74 6f 20     # A thing to 
1e630 6b 65 65 70 20 69 6e 20 6d 69 6e 64 20 69 73 20  keep in mind is 
1e640 61 6c 73 6f 20 74 68 61 74 20 74 68 65 20 22 75  also that the "u
1e650 6e 77 72 61 70 22 20 63 6f 6d 6d 61 6e 64 20 0a  nwrap" command .
1e660 20 20 20 20 23 20 72 65 76 65 72 74 73 20 74 6f      # reverts to
1e670 20 74 68 65 20 22 76 65 72 69 66 79 5f 70 61 63   the "verify_pac
1e680 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74 5f  ket_name_format_
1e690 76 31 22 20 63 6f 6d 6d 61 6e 64 2c 20 69 66 20  v1" command, if 
1e6a0 74 68 65 20 0a 20 20 20 20 23 20 66 69 6c 65 20  the .    # file 
1e6b0 6e 61 6d 65 20 6f 66 20 61 20 53 69 6c 6b 74 6f  name of a Silkto
1e6c0 72 72 65 6e 74 20 70 61 63 6b 65 74 20 63 61 6e  rrent packet can
1e6d0 64 69 64 61 74 65 20 63 6f 6e 74 61 69 6e 73 20  didate contains 
1e6e0 61 6e 79 20 73 70 61 63 65 73 2e 0a 20 20 20 20  any spaces..    
1e6f0 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
1e700 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e710 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e720 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e730 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b  -------.    if [
1e740 20 22 24 53 42 5f 52 45 51 55 45 53 54 45 44 5f   "$SB_REQUESTED_
1e750 41 43 54 49 4f 4e 5f 45 58 49 53 54 53 22 20 21  ACTION_EXISTS" !
1e760 3d 20 22 74 22 20 5d 3b 20 74 68 65 6e 20 23 20  = "t" ]; then # 
1e770 6c 61 63 6b 20 6f 66 20 61 63 74 69 6f 6e 20 69  lack of action i
1e780 6e 63 6c 75 64 65 64 0a 20 20 20 20 20 20 20 20  ncluded.        
1e790 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f  func_mmmv_silkto
1e7a0 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74  rrent_packager_t
1e7b0 31 5f 62 61 73 68 5f 70 72 69 6e 74 5f 68 65 6c  1_bash_print_hel
1e7c0 70 5f 6d 73 67 5f 74 31 0a 20 20 20 20 20 20 20  p_msg_t1.       
1e7d0 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63   #----.        c
1e7e0 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20  d $S_FP_ORIG.   
1e7f0 20 20 20 20 20 65 78 69 74 20 31 20 23 20 65 78       exit 1 # ex
1e800 69 74 20 77 69 74 68 20 61 6e 20 65 72 72 6f 72  it with an error
1e810 0a 20 20 20 20 66 69 0a 20 20 20 20 53 42 5f 52  .    fi.    SB_R
1e820 45 51 55 45 53 54 45 44 5f 41 43 54 49 4f 4e 5f  EQUESTED_ACTION_
1e830 45 58 49 53 54 53 3d 22 66 22 20 23 20 61 20 72  EXISTS="f" # a r
1e840 65 73 65 74 20 74 6f 20 61 6e 74 69 63 69 70 61  eset to anticipa
1e850 74 65 20 66 6c 61 77 73 20 65 6c 73 65 77 68 65  te flaws elsewhe
1e860 72 65 0a 20 20 20 20 23 20 54 68 65 20 61 63 74  re.    # The act
1e870 69 6f 6e 20 6e 61 6d 65 20 74 65 73 74 20 61 62  ion name test ab
1e880 6f 76 65 20 68 61 73 20 74 6f 20 62 65 20 62 65  ove has to be be
1e890 66 6f 72 65 20 74 68 65 20 0a 20 20 20 20 69 66  fore the .    if
1e8a0 20 5b 20 22 24 53 42 5f 46 49 4c 45 5f 52 45 51   [ "$SB_FILE_REQ
1e8b0 55 49 52 45 44 22 20 3d 3d 20 22 74 22 20 5d 3b  UIRED" == "t" ];
1e8c0 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 66 75   then.        fu
1e8d0 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72  nc_mmmv_silktorr
1e8e0 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f  ent_packager_t1_
1e8f0 62 61 73 68 5f 65 78 63 5f 61 73 73 65 72 74 5f  bash_exc_assert_
1e900 77 72 61 70 70 61 62 6c 65 5f 66 69 6c 65 5f 65  wrappable_file_e
1e910 78 69 73 74 73 5f 74 31 20 22 24 53 5f 41 52 47  xists_t1 "$S_ARG
1e920 56 5f 31 22 0a 20 20 20 20 65 6c 73 65 20 0a 20  V_1".    else . 
1e930 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76         func_mmmv
1e940 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63  _silktorrent_pac
1e950 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f 65 78  kager_t1_bash_ex
1e960 63 5f 61 73 73 65 72 74 5f 70 61 63 6b 65 74 5f  c_assert_packet_
1e970 6e 61 6d 65 5f 63 61 6e 64 69 64 61 74 65 5f 65  name_candidate_e
1e980 78 69 73 74 73 5f 74 31 20 22 24 53 5f 41 52 47  xists_t1 "$S_ARG
1e990 56 5f 31 22 0a 20 20 20 20 66 69 0a 20 20 20 20  V_1".    fi.    
1e9a0 23 20 62 65 63 61 75 73 65 20 6f 74 68 65 72 77  # because otherw
1e9b0 69 73 65 20 74 68 65 20 65 72 72 6f 72 20 6d 65  ise the error me
1e9c0 73 73 61 67 65 73 20 77 6f 75 6c 64 20 62 65 20  ssages would be 
1e9d0 69 6e 63 6f 72 72 65 63 74 2e 0a 20 20 20 20 23  incorrect..    #
1e9e0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 23 20 54  --------.    # T
1e9f0 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 75 70  he following dup
1ea00 6c 69 63 61 74 69 6e 67 20 73 65 72 69 65 73 20  licating series 
1ea10 6f 66 20 69 66 2d 63 6c 61 75 73 65 73 20 69 73  of if-clauses is
1ea20 20 74 6f 20 61 6c 6c 6f 77 20 0a 20 20 20 20 23   to allow .    #
1ea30 20 61 63 74 69 6f 6e 73 20 74 6f 20 68 61 76 65   actions to have
1ea40 20 61 6c 69 61 73 65 73 2e 0a 20 20 20 20 69 66   aliases..    if
1ea50 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52 45   [ "$S_SILKTORRE
1ea60 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41  NT_PACKAGER_T1_A
1ea70 43 54 49 4f 4e 22 20 3d 3d 20 22 77 72 61 70 22  CTION" == "wrap"
1ea80 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1ea90 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74   func_mmmv_silkt
1eaa0 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
1eab0 74 31 5f 62 61 73 68 5f 77 72 61 70 5f 74 31 20  t1_bash_wrap_t1 
1eac0 22 24 53 5f 41 52 47 56 5f 31 22 0a 20 20 20 20  "$S_ARGV_1".    
1ead0 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 20 20      #----.      
1eae0 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49 47 0a    cd $S_FP_ORIG.
1eaf0 20 20 20 20 20 20 20 20 65 78 69 74 20 30 20 23          exit 0 #
1eb00 20 65 78 69 74 20 77 69 74 68 6f 75 74 20 61 6e   exit without an
1eb10 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a 20 20   error.    fi.  
1eb20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66 20 5b    #----.    if [
1eb30 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54   "$S_SILKTORRENT
1eb40 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54  _PACKAGER_T1_ACT
1eb50 49 4f 4e 22 20 3d 3d 20 22 75 6e 77 72 61 70 22  ION" == "unwrap"
1eb60 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20 20 20   ]; then.       
1eb70 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b 74   func_mmmv_silkt
1eb80 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72 5f  orrent_packager_
1eb90 74 31 5f 62 61 73 68 5f 75 6e 77 72 61 70 5f 74  t1_bash_unwrap_t
1eba0 31 20 22 24 53 5f 41 52 47 56 5f 31 22 0a 20 20  1 "$S_ARGV_1".  
1ebb0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1ebc0 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1ebd0 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30  G.        exit 0
1ebe0 20 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20   # exit without 
1ebf0 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1ec00 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66      #----.    if
1ec10 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52 45   [ "$S_SILKTORRE
1ec20 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41  NT_PACKAGER_T1_A
1ec30 43 54 49 4f 4e 22 20 3d 3d 20 22 76 65 72 69 66  CTION" == "verif
1ec40 79 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20 20 20  y" ]; then.     
1ec50 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c     func_mmmv_sil
1ec60 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65  ktorrent_package
1ec70 72 5f 74 31 5f 62 61 73 68 5f 76 65 72 69 66 79  r_t1_bash_verify
1ec80 5f 66 69 6c 65 5f 6e 61 6d 65 5f 74 31 20 22 24  _file_name_t1 "$
1ec90 53 5f 41 52 47 56 5f 31 22 0a 20 20 20 20 20 20  S_ARGV_1".      
1eca0 20 20 65 63 68 6f 20 22 24 53 5f 46 55 4e 43 5f    echo "$S_FUNC_
1ecb0 4d 4d 4d 56 5f 53 49 4c 4b 54 4f 52 52 45 4e 54  MMMV_SILKTORRENT
1ecc0 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 42 41 53  _PACKAGER_T1_BAS
1ecd0 48 5f 56 45 52 49 46 59 5f 46 49 4c 45 5f 4e 41  H_VERIFY_FILE_NA
1ece0 4d 45 5f 54 31 5f 52 45 53 55 4c 54 22 0a 20 20  ME_T1_RESULT".  
1ecf0 20 20 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20        #----.    
1ed00 20 20 20 20 63 64 20 24 53 5f 46 50 5f 4f 52 49      cd $S_FP_ORI
1ed10 47 0a 20 20 20 20 20 20 20 20 65 78 69 74 20 30  G.        exit 0
1ed20 20 23 20 65 78 69 74 20 77 69 74 68 6f 75 74 20   # exit without 
1ed30 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 66 69 0a  an error.    fi.
1ed40 20 20 20 20 23 2d 2d 2d 2d 0a 20 20 20 20 69 66      #----.    if
1ed50 20 5b 20 22 24 53 5f 53 49 4c 4b 54 4f 52 52 45   [ "$S_SILKTORRE
1ed60 4e 54 5f 50 41 43 4b 41 47 45 52 5f 54 31 5f 41  NT_PACKAGER_T1_A
1ed70 43 54 49 4f 4e 22 20 3d 3d 20 22 74 65 73 74 5f  CTION" == "test_
1ed80 68 61 73 68 5f 74 31 22 20 5d 3b 20 74 68 65 6e  hash_t1" ]; then
1ed90 0a 20 20 20 20 20 20 20 20 66 75 6e 63 5f 6d 6d  .        func_mm
1eda0 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74 5f 70  mv_silktorrent_p
1edb0 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73 68 5f  ackager_t1_bash_
1edc0 74 65 73 74 5f 31 20 22 24 53 5f 41 52 47 56 5f  test_1 "$S_ARGV_
1edd0 31 22 0a 20 20 20 20 20 20 20 20 23 2d 2d 2d 2d  1".        #----
1ede0 0a 20 20 20 20 20 20 20 20 63 64 20 24 53 5f 46  .        cd $S_F
1edf0 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20 20 65  P_ORIG.        e
1ee00 78 69 74 20 30 20 23 20 65 78 69 74 20 77 69 74  xit 0 # exit wit
1ee10 68 6f 75 74 20 61 6e 20 65 72 72 6f 72 0a 20 20  hout an error.  
1ee20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d 2d 2d    fi.    #------
1ee30 2d 2d 0a 20 20 20 20 23 20 53 74 61 72 74 20 6f  --.    # Start o
1ee40 66 20 61 63 74 69 6f 6e 73 20 74 68 61 74 20 64  f actions that d
1ee50 6f 20 6e 6f 74 20 72 65 71 75 69 72 65 20 61 20  o not require a 
1ee60 66 69 6c 65 3a 0a 20 20 20 20 69 66 20 5b 20 22  file:.    if [ "
1ee70 24 53 5f 53 49 4c 4b 54 4f 52 52 45 4e 54 5f 50  $S_SILKTORRENT_P
1ee80 41 43 4b 41 47 45 52 5f 54 31 5f 41 43 54 49 4f  ACKAGER_T1_ACTIO
1ee90 4e 22 20 3d 3d 20 22 76 65 72 69 66 79 5f 70 61  N" == "verify_pa
1eea0 63 6b 65 74 5f 6e 61 6d 65 5f 66 6f 72 6d 61 74  cket_name_format
1eeb0 5f 76 31 22 20 5d 3b 20 74 68 65 6e 0a 20 20 20  _v1" ]; then.   
1eec0 20 20 20 20 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73       func_mmmv_s
1eed0 69 6c 6b 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61  ilktorrent_packa
1eee0 67 65 72 5f 74 31 5f 62 61 73 68 5f 76 65 72 69  ger_t1_bash_veri
1eef0 66 79 5f 70 61 63 6b 65 74 5f 6e 61 6d 65 5f 66  fy_packet_name_f
1ef00 6f 72 6d 61 74 5f 76 31 20 22 24 53 5f 41 52 47  ormat_v1 "$S_ARG
1ef10 56 5f 31 22 0a 20 20 20 20 20 20 20 20 23 2d 2d  V_1".        #--
1ef20 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24 53  --.        cd $S
1ef30 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20 20  _FP_ORIG.       
1ef40 20 65 78 69 74 20 30 20 23 20 65 78 69 74 20 77   exit 0 # exit w
1ef50 69 74 68 6f 75 74 20 61 6e 20 65 72 72 6f 72 0a  ithout an error.
1ef60 20 20 20 20 66 69 0a 20 20 20 20 23 2d 2d 2d 2d      fi.    #----
1ef70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ef80 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 20 20 20 20 65  ------.        e
1ef90 63 68 6f 20 22 22 20 0a 20 20 20 20 20 20 20 20  cho "" .        
1efa0 65 63 68 6f 20 22 54 68 69 73 20 62 61 73 68 20  echo "This bash 
1efb0 73 63 72 69 70 74 20 69 73 20 66 6c 61 77 65 64  script is flawed
1efc0 2e 20 54 68 65 20 63 6f 6e 74 72 6f 6c 20 66 6c  . The control fl
1efd0 6f 77 20 22 20 0a 20 20 20 20 20 20 20 20 65 63  ow " .        ec
1efe0 68 6f 20 22 73 68 6f 75 6c 64 20 68 61 76 65 20  ho "should have 
1eff0 6e 65 76 65 72 20 72 65 61 63 68 65 64 20 74 68  never reached th
1f000 69 73 20 6c 69 6e 65 2e 22 0a 20 20 20 20 20 20  is line.".      
1f010 20 20 65 63 68 6f 20 22 47 55 49 44 3d 3d 27 33    echo "GUID=='3
1f020 30 63 32 34 32 31 34 2d 32 38 34 35 2d 34 35 61  0c24214-2845-45a
1f030 64 2d 38 34 31 64 2d 38 30 32 30 37 30 65 30 33  d-841d-802070e03
1f040 31 65 37 27 22 0a 20 20 20 20 20 20 20 20 65 63  1e7'".        ec
1f050 68 6f 20 22 22 0a 20 20 20 20 20 20 20 20 23 2d  ho "".        #-
1f060 2d 2d 2d 0a 20 20 20 20 20 20 20 20 63 64 20 24  ---.        cd $
1f070 53 5f 46 50 5f 4f 52 49 47 0a 20 20 20 20 20 20  S_FP_ORIG.      
1f080 20 20 65 78 69 74 20 31 20 23 20 65 78 69 74 20    exit 1 # exit 
1f090 77 69 74 68 20 61 6e 20 65 72 72 6f 72 0a 7d 20  with an error.} 
1f0a0 23 20 66 75 6e 63 5f 6d 6d 6d 76 5f 73 69 6c 6b  # func_mmmv_silk
1f0b0 74 6f 72 72 65 6e 74 5f 70 61 63 6b 61 67 65 72  torrent_packager
1f0c0 5f 74 31 5f 62 61 73 68 5f 64 65 74 65 72 6d 69  _t1_bash_determi
1f0d0 6e 65 5f 61 63 74 69 6f 6e 0a 0a 66 75 6e 63 5f  ne_action..func_
1f0e0 6d 6d 6d 76 5f 73 69 6c 6b 74 6f 72 72 65 6e 74  mmmv_silktorrent
1f0f0 5f 70 61 63 6b 61 67 65 72 5f 74 31 5f 62 61 73  _packager_t1_bas
1f100 68 5f 64 65 74 65 72 6d 69 6e 65 5f 61 63 74 69  h_determine_acti
1f110 6f 6e 20 24 31 20 24 32 20 24 33 20 24 34 20 24  on $1 $2 $3 $4 $
1f120 35 20 24 36 20 24 37 0a 0a 0a 23 2d 2d 2d 2d 2d  5 $6 $7...#-----
1f130 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f140 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f150 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f160 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f170 2d 2d 2d 2d 2d 0a 0a 0a 23 2d 2d 2d 2d 2d 2d 2d  -----...#-------
1f180 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f190 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f1a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f1b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f1c0 2d 2d 2d 0a 63 64 20 24 53 5f 46 50 5f 4f 52 49  ---.cd $S_FP_ORI
1f1d0 47 0a 65 78 69 74 20 30 20 23 20 0a 0a 23 3d 3d  G.exit 0 # ..#==
1f1e0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f1f0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f200 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f210 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f220 3d 3d 3d 3d 3d 3d 3d 3d 0a 23 20 46 72 61 67 6d  ========.# Fragm
1f230 65 6e 74 73 20 6f 66 20 63 6f 6d 6d 65 6e 74 73  ents of comments
1f240 20 61 6e 64 20 63 6f 64 65 20 74 68 61 74 20 6d   and code that m
1f250 69 67 68 74 20 66 69 6e 64 20 75 73 65 20 73 6f  ight find use so
1f260 6d 65 20 74 69 6d 65 73 20 6c 61 74 65 72 3a 0a  me times later:.
1f270 23 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  #---------------
1f280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f2a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f2b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 0a 23 20  -----------.#.# 
1f2c0 20 20 6d 61 78 20 35 35 20 63 68 61 72 61 63 74    max 55 charact
1f2d0 65 72 73 20 2d 2d 2d 20 70 61 63 6b 61 67 65 20  ers --- package 
1f2e0 73 75 67 67 65 73 74 65 64 20 64 65 70 72 65 63  suggested deprec
1f2f0 61 74 69 6f 6e 20 64 61 74 65 20 69 6e 20 6e 61  ation date in na
1f300 6e 6f 73 65 63 6f 6e 64 73 0a 23 20 20 20 20 20  noseconds.#     
1f310 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f320 20 20 20 20 72 65 6c 61 74 69 76 65 20 74 6f 20      relative to 
1f330 74 68 65 20 55 6e 69 78 20 45 70 6f 63 68 2c 20  the Unix Epoch, 
1f340 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .#              
1f350 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 74             writt
1f360 65 6e 20 69 6e 20 62 61 73 65 20 31 30 2e 20 49  en in base 10. I
1f370 74 20 63 61 6e 20 62 65 20 6e 65 67 61 74 69 76  t can be negativ
1f380 65 2e 0a 23 20 20 20 20 20 20 20 20 20 20 20 20  e..#            
1f390 20 20 20 20 20 20 20 20 20 20 20 20 20 72 67 78               rgx
1f3a0 5f 69 6e 5f 72 75 62 79 3d 2f 74 28 28 79 5b 2d  _in_ruby=/t((y[-
1f3b0 5d 3f 5b 5c 64 5d 2b 29 7c 6e 29 5b 5f 5d 2f 0a  ]?[\d]+)|n)[_]/.
1f3c0 23 20 65 63 68 6f 20 22 76 30 30 33 34 5f 73 32  # echo "v0034_s2
1f3d0 33 34 32 5f 74 6e 5f 22 20 7c 20 67 61 77 6b 20  342_tn_" | gawk 
1f3e0 27 7b 20 67 73 75 62 28 2f 5f 2f 2c 20 22 5f 5c  '{ gsub(/_/, "_\
1f3f0 6e 22 29 3b 20 70 72 69 6e 74 20 7d 27 20 7c 20  n"); print }' | 
1f400 5c 0a 23 20 20 20 20 20 20 20 20 20 20 20 20 20  \.#             
1f410 20 20 20 20 20 20 20 20 20 20 20 20 20 67 61 77               gaw
1f420 6b 20 27 2f 5e 74 28 79 5b 2d 5d 3f 5b 30 2d 39  k '/^t(y[-]?[0-9
1f430 5d 2b 7c 6e 29 5f 2f 20 7b 70 72 69 6e 74 66 20  ]+|n)_/ {printf 
1f440 22 25 73 22 2c 24 31 20 7d 27 20 7c 0a 23 20 20  "%s",$1 }' |.#  
1f450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1f460 20 20 20 20 20 20 20 20 67 61 77 6b 20 27 7b 67          gawk '{g
1f470 73 75 62 28 2f 5b 74 79 6e 5f 5d 2f 2c 22 22 29  sub(/[tyn_]/,"")
1f480 3b 70 72 69 6e 74 66 20 22 25 73 22 2c 20 24 31  ;printf "%s", $1
1f490 20 7d 27 0a 23 20 20 20 20 20 20 20 20 20 20 20   }'.#           
1f4a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 23                .#
1f4b0 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 54 68 65  .#--------.# The
1f4c0 20 61 77 6b 20 63 6f 64 65 20 65 78 61 6d 70 6c   awk code exampl
1f4d0 65 20 6f 72 69 67 69 6e 61 74 65 73 20 66 72 6f  e originates fro
1f4e0 6d 20 0a 23 20 68 74 74 70 3a 2f 2f 77 77 77 2e  m .# http://www.
1f4f0 6c 69 6e 75 78 61 6e 64 6c 69 66 65 2e 63 6f 6d  linuxandlife.com
1f500 2f 32 30 31 33 2f 30 36 2f 68 6f 77 2d 74 6f 2d  /2013/06/how-to-
1f510 72 65 76 65 72 73 65 2d 73 74 72 69 6e 67 2e 68  reverse-string.h
1f520 74 6d 6c 0a 23 20 61 72 63 68 69 76 61 6c 20 63  tml.# archival c
1f530 6f 70 79 3a 20 68 74 74 70 73 3a 2f 2f 61 72 63  opy: https://arc
1f540 68 69 76 65 2e 69 73 2f 43 78 30 78 46 0a 23 20  hive.is/Cx0xF.# 
1f550 53 5f 54 4d 50 5f 30 3d 22 60 70 72 69 6e 74 66  S_TMP_0="`printf
1f560 20 22 24 53 5f 49 4e 22 20 7c 20 5c 0a 23 20 20   "$S_IN" | \.#  
1f570 20 20 61 77 6b 20 27 7b 20 66 6f 72 28 69 3d 6c    awk '{ for(i=l
1f580 65 6e 67 74 68 3b 69 21 3d 30 3b 69 2d 2d 29 78  ength;i!=0;i--)x
1f590 3d 78 20 73 75 62 73 74 72 28 24 30 2c 69 2c 31  =x substr($0,i,1
1f5a0 29 3b 7d 45 4e 44 7b 70 72 69 6e 74 66 20 20 78  );}END{printf  x
1f5b0 7d 27 60 22 0a 23 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  }'`".#--------.#
1f5c0 0a 23 53 5f 54 4d 50 5f 30 3d 22 60 70 72 69 6e  .#S_TMP_0="`prin
1f5d0 74 66 20 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f  tf \"$S_NAME_OF_
1f5e0 54 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 32  THE_EXECUTABLE_2
1f5f0 5c 22 20 7c 20 67 61 77 6b 20 27 7b 67 73 75 62  \" | gawk '{gsub
1f600 28 2f 5c 73 2f 2c 22 22 29 3b 70 72 69 6e 74 66  (/\s/,"");printf
1f610 20 22 25 73 22 2c 20 24 31 20 7d 27 60 22 0a 23   "%s", $1 }'`".#
1f620 53 5f 54 4d 50 5f 30 3d 24 28 20 70 72 69 6e 74  S_TMP_0=$( print
1f630 66 20 22 24 53 5f 43 41 4e 44 49 44 41 54 45 22  f "$S_CANDIDATE"
1f640 20 7c 20 67 61 77 6b 20 27 7b 67 73 75 62 28 2f   | gawk '{gsub(/
1f650 5e 5b 2b 5d 2f 2c 22 22 29 3b 20 70 72 69 6e 74  ^[+]/,""); print
1f660 66 20 22 25 73 22 2c 20 24 31 7d 27 20 29 0a 23  f "%s", $1}' ).#
1f670 53 5f 54 4d 50 5f 31 3d 24 28 20 70 72 69 6e 74  S_TMP_1=$( print
1f680 66 20 22 24 53 5f 54 4d 50 5f 30 22 20 20 20 20  f "$S_TMP_0"    
1f690 20 7c 20 67 61 77 6b 20 27 7b 67 73 75 62 28 2f   | gawk '{gsub(/
1f6a0 5b 30 31 32 33 34 35 36 37 38 39 5d 2b 2f 2c 22  [0123456789]+/,"
1f6b0 22 29 3b 20 70 72 69 6e 74 66 20 22 25 73 22 2c  "); printf "%s",
1f6c0 20 24 31 7d 27 20 29 0a 23 53 5f 54 4d 50 5f 30   $1}' ).#S_TMP_0
1f6d0 3d 24 28 20 70 72 69 6e 74 66 20 22 24 53 5f 43  =$( printf "$S_C
1f6e0 41 4e 44 49 44 41 54 45 22 20 7c 20 67 61 77 6b  ANDIDATE" | gawk
1f6f0 20 27 7b 67 73 75 62 28 2f 5c 73 2b 2f 2c 22 22   '{gsub(/\s+/,""
1f700 29 3b 20 70 72 69 6e 74 66 20 22 25 73 22 2c 20  ); printf "%s", 
1f710 24 31 7d 27 20 29 0a 23 53 5f 54 4d 50 5f 31 3d  $1}' ).#S_TMP_1=
1f720 24 28 20 70 72 69 6e 74 66 20 22 24 53 5f 54 4d  $( printf "$S_TM
1f730 50 5f 30 22 20 7c 20 67 61 77 6b 20 27 7b 67 73  P_0" | gawk '{gs
1f740 75 62 28 2f 5e 5b 30 5d 2b 2f 2c 22 22 29 3b 20  ub(/^[0]+/,""); 
1f750 70 72 69 6e 74 66 20 22 25 73 22 2c 20 24 31 7d  printf "%s", $1}
1f760 27 20 29 0a 23 53 5f 54 4d 50 5f 30 3d 22 60 70  ' ).#S_TMP_0="`p
1f770 72 69 6e 74 66 20 20 5c 22 24 53 5f 4e 41 4d 45  rintf  \"$S_NAME
1f780 5f 4f 46 5f 54 48 45 5f 42 41 53 48 5f 46 55 4e  _OF_THE_BASH_FUN
1f790 43 54 49 4f 4e 5c 22 20 7c 20 67 61 77 6b 20 27  CTION\" | gawk '
1f7a0 7b 67 73 75 62 28 2f 5c 73 2f 2c 22 22 29 3b 70  {gsub(/\s/,"");p
1f7b0 72 69 6e 74 66 20 22 25 73 22 2c 20 24 31 20 7d  rintf "%s", $1 }
1f7c0 27 60 22 0a 23 53 5f 54 4d 50 5f 30 3d 22 60 70  '`".#S_TMP_0="`p
1f7d0 72 69 6e 74 66 20 20 5c 22 24 53 5f 46 50 5f 32  rintf  \"$S_FP_2
1f7e0 5f 41 4e 5f 45 58 49 53 54 49 4e 47 5f 46 49 4c  _AN_EXISTING_FIL
1f7f0 45 5c 22 20 7c 20 67 61 77 6b 20 27 7b 67 73 75  E\" | gawk '{gsu
1f800 62 28 2f 5c 73 2f 2c 22 22 29 3b 70 72 69 6e 74  b(/\s/,"");print
1f810 66 20 22 25 73 22 2c 20 24 31 20 7d 27 60 22 0a  f "%s", $1 }'`".
1f820 23 53 5f 54 4d 50 5f 30 3d 22 60 70 72 69 6e 74  #S_TMP_0="`print
1f830 66 20 5c 22 24 53 5f 4e 41 4d 45 5f 4f 46 5f 54  f \"$S_NAME_OF_T
1f840 48 45 5f 45 58 45 43 55 54 41 42 4c 45 5f 32 5c  HE_EXECUTABLE_2\
1f850 22 20 7c 20 67 61 77 6b 20 27 7b 67 73 75 62 28  " | gawk '{gsub(
1f860 2f 5c 73 2f 2c 22 22 29 3b 70 72 69 6e 74 66 20  /\s/,"");printf 
1f870 22 25 73 22 2c 20 24 31 20 7d 27 60 22 0a 0a 23  "%s", $1 }'`"..#
1f880 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f890 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f8a0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f8b0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
1f8c0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a              ==========..