home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 361_01 / readme.txt < prev    next >
Text File  |  1991-09-20  |  29KB  |  762 lines

  1.  
  2.    In the process of tidy-up as    this three year    project    ends (itself a 
  3. spin-off of a decade long effort), I have gathered together a number of    
  4. routines I have    found useful & set up a    SMALL and LARGE    model Turbo-C (v2.0) 
  5. library    for local distribution.
  6.  
  7.    Since there is room left on a 360K Floppy, I    also tossed in a few Tools, 
  8. among them Valve, Chopper and three cypher programs.
  9.  
  10.    I include a TIS (Text Indexed Sequential) keyed "Manual" for    the library 
  11. and Vu to access and search it.     While C-coding, I freqwently refer to this 
  12. file using HKM,    a TSR built using Al Steven's "popup.c"    and "resident.c" TSR 
  13. routines from "Turbo-C Memory-Resident Utilities, Screen I/O and Programming 
  14. Techniques" (MIS Press,    1987) and modules lifted from Vu.
  15.  
  16.    I also include a Quick & Dirty solution to the puny DOS pipe    problem:
  17.  
  18. =============================[ PX Pipes    ]====================================
  19.  
  20.    Pipe: A One-Way Link    connceting the Output of One Program to    the Input of 
  21.      Another.  Symbol: "|".
  22.  
  23.  Filter: A program intended to be Piped    on Both    Sides.    Example: SORT
  24.  
  25.    Tool: A Program (usually small) which does One Thing    Well.
  26.  
  27. -----------------------------------------------------------------------------
  28.  
  29.    Currently, there are    (at least) three competing philosphies about PC    Use: 
  30.  
  31.    1. Launch an    Application and    Do All Work there.  Example: dBASE.
  32.    2. Overload a Graphics User Interface (GUI) and operate in a    Mouse/Icon 
  33.       Environment.  Example: MS-Windows.
  34.    3. Perform Processes    on Text    Files from the Command Line Interface (CLI).
  35.       Example: Unix.
  36.    
  37.    This    is an exploration of the last (Unix-style) philosophy as implemented 
  38. on the PC.  Although hobbled by    lack of    Virtual    Memory,    a Tiny (by Unix    
  39. standars) RAM and inadequate disk space, DOS can do a surprisingly good    job 
  40. when fitted w/ the right Tools,    some "Magic" and a knowledgeable User.
  41.  
  42.    That's right.  Tools    demand intellegent Users, which    is probably why    Unix 
  43. has been so slow to go "Mainstream".  The PC is    a difficult machine in many 
  44. aspects, BATch Files being one of them and, as you might expect, BATch Files 
  45. are essentual to effective Tool    use.
  46.  
  47.    Text    Files are the Raw materials and    End product of Tool Use.  Many tasks 
  48. which naturally    occur in the course of our daily work involve the 
  49. manipulation, transformation or    analysis of Text Files.     Just are as a Wood 
  50. Wright cuts, shapes and    polishes Wood, DOS can cut, shape and polish Text.
  51.  
  52.    The Unix Philosophy is to create and    use simple Tools which,    when linked 
  53. together, can do complex tasks quickly.     The "Link" is the Command Line    Pipe, 
  54. "|".  As in Early Unix,    DOS Pipes are actual Files which are created, used 
  55. and erased as the Command Line carries out your    wishes.     (A "Crash" might
  56. leave them in the Root Directory, names    consisting of strictly numbers and 
  57. often completely empty).
  58.  
  59.    For many situations,    you need only begin the    Command    Line by    TYPEing    out 
  60. the Source Text    and "Squirting"    the finished product into a File like so:
  61.  
  62. C:>TYPE    source.txt | FIND "something" |    SORT > target.txt
  63.    
  64.    That    works well enough as long as your processing is    simple and your    Tool 
  65. names (and Arguements and Option Switches) are compact enough to fit on    DOS's
  66. 127 character Command Line.  When they do not, you can use "Temporary" Files 
  67. to pass    Text from Line to Line.
  68.  
  69.    From    that simple process (passing Text from Line to Line) came a Family of 
  70. "Pipe Extenders" that resolve many of the problems Tool    Users encounter    on 
  71. DOS.  The first    (most basic) pipe extender is "PX".  It    allows the above 
  72. example    to be split like so:
  73.  
  74. C:>TYPE    source.txt | FIND "something" |    PX
  75.  
  76. C:>PX |    SORT > target.txt
  77.  
  78.    PX creates a    File in    Root, accepts Text from    an Inflow Pipe and later 
  79. TYPEs it into an Outflow Pipe.    Being only two letters,    PX takes up very 
  80. little of that precious    127 character Command Line, a Plus.
  81.  
  82.    The above works on the Command Line (PX can tell where the Pipes are).  
  83. Inside BATch Files, the    "Sniffer" doesn't work,    so you have to use Flow    
  84. Control    Flags, like this:
  85.  
  86. TYPE source.txt    | FIND "something" | PX    /W
  87. PX /R |    SORT > target.txt
  88.  
  89. ---------------------------------[ Named Pipes ]----------------------------
  90.  
  91.    PX uses an "Illegal"    file name containing a Space.  Command.Com and 
  92. everything in DOS avoids embedded Spaces, but CP/M allowed them, so the    DOS 
  93. File System (to    maintain backwards compatibility) allows them, too.  PX    uses 
  94. such names to avoid any    possible conflict with DOS or existing application 
  95. programs.
  96.  
  97.    When    it was decided to allow    the User to specify file names for PX to use, 
  98. the real names could not be passed thru    Command.Com.  It was decided to    let 
  99. the User specify the last 4 characters of the name (providing several million 
  100. choices), but signify that this    is a Pipe Name by using    "$" in place of    the 
  101. "Illegal" part of the name.
  102.  
  103.    By this convention, PX defaults to a    Pipe Named "$OUT":
  104.  
  105. C:>TYPE    source.txt | FIND "something" |    PX $OUT
  106.  
  107. C:>PX $OUT | SORT > target.txt
  108.  
  109.    Tools which allow $Pipes will say so    in their "Barefoot" use    message.
  110.  
  111. -----------------------------[ Piping BATch Files ]--------------------------
  112.  
  113.    By now you may have guessed that PX can "Jump the Fence" into and out of 
  114. .BATch Files.  Flow into a PX Pipe outside the BATch File, read    it inside, 
  115. refill it with the results and exit.  Later on,    read the PX Pipe.  Works 
  116. every time.
  117.  
  118.    Unfortunately, you can't Pipefit a BATch File into a    Pipeline using the 
  119. above method.  For one thing, to call a    BATch File within a Pipeline, you 
  120. have to    spawn a    Secondary Shell    using "Command /C ":
  121.  
  122.  .. | PX /W | Command.com /C mybat | PX    /R | ...
  123.  
  124.    Which is equivalent to:
  125.    
  126.  .. | PX myfile    | PX | ...   (PX spawns    the Secondary Shell)
  127.  
  128.    All the restrictions    of the "/C" option apply except    one: PX    will convert 
  129. single quotes to double    quotes as it passes "myfile" and its arguements    to 
  130. the Secondary Shell.  (Just enclose "myfile 'arg1' 'arg2' ..." in double 
  131. quotes).  Notice also that PX didn't need the "/W" & "/R" flags    (even in a 
  132. BATch File).
  133.  
  134.    Sometimes you want a    BATch File to print out    to the CRT when    used from the
  135. Command    Line, but use a    $Pipe when called in a Pipeline    by PX:
  136.  
  137. DIR | FIND "-" | FIND /V "<" | CUT 12 |    TRIM | TR /S " " | TR "    " "." |    PXO
  138.  
  139.    The above Pipeline was taken    from Ls.BAT, a "DOS Script" (PX    can Call it 
  140. inside other BATch Files). 
  141.  
  142. -----------------------------[ Pipefitting ]---------------------------------
  143.    
  144.    Once    you have the ability to    build Scripts, many of the techniques used by 
  145. Unix Shell Programmers can be done in DOS.  One    serious    problem    remains: How 
  146. do you pass the    contents of a Pipe to a    Command?
  147.  
  148.    For example,    Ls gives you a list of File Names, how can you present that 
  149. to the User for    him to select some (several or one) to copy to a Floppy?
  150.  
  151.    PX Ls | PX |    MSO /R | RSX "DO COPY $1 A:"
  152.  
  153.    The first part uses "Ls" as "myfile"    as discussed above.  The Piped 
  154. outflow    of that    (a list    of file    names) is presented to the User    who can    
  155. select which ones he wants copied.  (See BatMan    MSO)
  156.  
  157.    "RSX" means "Read-Single-Execute", a    variation of PX    that repeats the 
  158. "command" over and over    until the Pipe runs dry.  Each line is "Parsed"    into 
  159. "Words"    ranging    from $1    thru $8    ($9 is the remainder, $0 is the    whole line).  
  160. Before execution, $1 (in this case) is replaced    by the first word on the line 
  161. read in.
  162.  
  163.    Notice that "command" is quoted (there is an    embedded space).  Since    we 
  164. want to    see the    Command    as it is being executed, "DO" is used (See MAN DO).   
  165.  
  166.    For those situations    where a    Select List isn't appropriate, you can Pop an 
  167. "Ask" Box onto the screen using    APO:
  168.  
  169.    APO /I *.*  "Enter Files" | rsx dir $0
  170.    
  171.    Try it.  Notice that    if you just hit    <Enter>    that only one DIR cycle    
  172. occurs.
  173.  
  174. -------------------------[ Final Thoughts ]---------------------------------
  175.  
  176.    If you can reduce your User Interactions to a Single    Keystroke, Keys.h (or 
  177. BATchman) can handle you needs via ERRORLEVELs.     If you    can't, use APO or MSO 
  178. to feed    text down a Pipeline.
  179.  
  180. =============================================================================
  181.   
  182. >APO.  A "Boxed" Ask w/    Prompting & Text Capture.  Squirts to Stdout.
  183.  
  184. Usage:
  185.     APO [/option] text [title]
  186.  
  187. Options:
  188.        /I ---> Ignore Case.  (Everything is UPPERS).
  189.        /N ---> Numbers Only.
  190.  
  191.    APO may be Piped w/o    Disrupting User    Input.
  192.  
  193.   Try It!  APO must be Piped for OutFlow (or It    isn't very Useful).
  194.  
  195.    APO is a Public Domain Program Written in C.
  196.  
  197. ==========================================================================
  198.  
  199. >CAT.  conCATinate Files/Pipes ala Unix    cat w/ Line Number & Queue Options.
  200.  
  201. Usage:
  202.        CAT [/Option or file list] ---> Stream Text to Outflow Pipe.
  203.  
  204. /Options:
  205.     /Q ---> Stack Stdin    Lines into 75 CHR$ max lines.
  206.     /N ---> Add    Line Numbers to    Each Stdin Line.
  207.     /T ---> Add    TEKTEST    Line Numbers to    Each Stdin Line.
  208.     /U ---> Remove Line    Numbers    from Each Stdin    Line.
  209.  
  210. File List:
  211.     File Names (Wild Cards OK),    $pipe or "-" for Stdin.
  212.  
  213. ----
  214.  
  215.    CAT will "glue together" a list of files/pipes into one continuous Text
  216. Stream.     Any EOF markers (^Z) are filtered out.
  217.  
  218.    CAT supports    the "PX" Named Pipe conventions.  Use $IN to read the
  219. default    PX pipe.
  220.  
  221. ----
  222.  
  223.    CAT does not    Rub-Out    Named Pipes after use.    You may    re-read    them by
  224. calling    CAT again.
  225.  
  226.    You can Rub-Out a Named Pipe    named "JEEP" like this:
  227.  
  228.    PX $JEEP | SORT > NUL
  229.  
  230.    PX must have    an Outflow Pipe    or flow    into a File.  NUL isn't    enough.
  231.  
  232. ----
  233.  
  234.    CAT operating under the "/Options" is strictly a Filter.  No    Files,
  235. please.
  236.  
  237. -----
  238.  
  239.    Note    to Unix    retreads: Use VIS for "cat -v" applications.
  240.  
  241.    CAT is a Public Domain program written in C.
  242.  
  243. ==========================================================================
  244.  
  245. >CHOPPER.  Hack    up a Text Stream into Printable    Lines.
  246.  
  247. Usage:
  248.        CHOPPER [[drive:][path]filename]--> Hack    Up Text    into Lines.
  249.  
  250.    $Pipes are Legal.
  251.  
  252.    If the Stream is Page-sized,    CHOPPER    is transparent.     Otherwise a "Wrap"
  253. action occurs w/ "" markers at    the inserted line break.
  254.  
  255.    "Choppered" Text can    be "DeWrapped" by piping thru: | SAR "$021?$021" |
  256.  
  257.    CHOPPER is a    Public Domain program written in C.
  258.  
  259. ==========================================================================
  260.  
  261. >CYPHERS.  A Toolbox of    Useful Encryption Techniques:
  262.  
  263. >ENIGMA.  Louis    XIV's "Great Cypher".
  264. >GARBLE.  A Text Stream    Scrambler used by Roman    Centurians.
  265. >FOG.     An 80% "Snow Factor" of Random "Noise".
  266.  
  267.    Cyphers have    been used by Governments and Armed Forces as far back as
  268. Roman times.  Today's secure Cyphers such as DES are algoritmic    based and
  269. (unless    you are    a real bit-head) about as interesting as oatmeal.
  270. Yesterday's Cyphers, the machines that (mechanically) implemented them and
  271. the techniques to analyze them spun off    the field of Information Theory.
  272. Because    they are well understood and documented, yesterday's Cyphers strongly
  273. influence today's hardware/software/system designs.
  274.  
  275.    Three Cypher    Tools have been    created    implementing three different schemes
  276. for "Covering" information.  All are written in    ANSI C and will    port directly
  277. to DOS and Posix platforms.  All generate seven    bit ASCII code suitable    for
  278. telecommunications via Sytek or    modem.
  279.  
  280.    These Tools ARE NOT suitable    for classified information (use    DES or other
  281. certified method), but will resist attacks (even by experts) long enough to
  282. discourage casual Snoops.  In effect, these are    "Honest    Man Locks",
  283. sufficient to remove the temptation to browse or tamper.
  284.  
  285.    The first is    a file scrambler called    "GARBLE".  It is based on the "Ribbon
  286. Trick" used by Roman Centurians    to encode/decode field orders.    Each Field
  287. Officer    was issued a Staff (appropriately adorned) as a    Symbol of Rank.
  288. Actually, it was a Cypher tool.     A length of ribbon was    wrapped    around the
  289. Staff.    The message was    written    along the Staff's axis and the ribbon
  290. unwound, rolled    up and "Mailed".  Without a cylinder of    correct    size, the
  291. ribbon's jamble    of letters was unreadable.  GABLE text resembles a binary
  292. file printout, which means a casual snoop would    skip it.
  293.  
  294.    The second Tool is a    Substitution Cypher based on Bazeries Cylinders, the
  295. defacto    standard cryptographic method through WW II.  Invented by Antoine
  296. Rossignol, court cryptanalyst to Louis XIV, the    secret to the "Great Cypher"
  297. died with him in 1715.    After a    century    of attack, Cmdr    Bazeries (of the
  298. French Army) cracked the code and invented a Cypher machine based on it.
  299. The German Enigma machine was an electro-mechanical version of that machine.
  300.  
  301.    Project Ultra and a special purpose electronic computer (Colossis) so
  302. thoroughly cracked Enigma that,    by D-Day, Allied Commanders often had German
  303. field orders before the    addressee.  So important was Project Ultra that
  304. all trace of it    remained classified until 1974.
  305.  
  306.    The classical Diplomatic Cylinder Cypher used only letters printed on the 
  307. periphery of 20    disks, each in a different scrambled order.  The "Key" 
  308. specified what order these disks were to be stacked.  ENIGMA faithfully    
  309. reproduces the action of these classic machines, except    that more disks    are 
  310. used (40) and more characters are used (79) so that the    entire 255 character
  311. Ascii/IBM code set can be handled.
  312.  
  313.    Using the /N    (neat) option, ENIGMA produces 5 letter    groups of
  314. printable text,    twelve groups/line.  This allows visual    inspection during
  315. telecommunications without exposing the    covered    text.  ENIGMA is well suited 
  316. as a "Mailer", an envelope in which a file can be placed during    "Mailing",
  317. especially if it must be "Parked" on a public system for later pickup.
  318.  
  319.    The third Cypher Tool, FOG, is based    on a trick used    by the KGB in the US
  320. during the early 1960's.  Embarrassingly simple    (the original decoder was 6 
  321. lines of BASIC code), the CIA never did    crack it, learning its secret only 
  322. after the KGB's    US Station Chief defected.
  323.  
  324.    FOG obscures    information by inserting an 80%    dose of    "Noise".  At the cost
  325. of a 5:1 bulk expansion, FOG allows secure transmission    of small items without
  326. need of    Keys.  Passwords are one of the    items FOG was intended to protect.
  327. Like ENIGMA, FOG can generate printable    text in    5 letter groups.
  328.  
  329. ==========================================================================
  330.  
  331. >HKM.  Hot-Key Manual.    A TIS Compliant    Utility    w/ TSR Power.
  332.  
  333. Usage:
  334.        HKM [options] path/manual.TXT  --> VU a Text File or TIS    Manual.
  335.  
  336. Options:
  337.        /C0xhhhh    -> Specify Colors.
  338.        /I -------> Install as a    TSR.  <Hot Key is ALT-Comma>.
  339.        /K -------> Jump    to Item    Select List First.
  340.        /R -------> Remove. (Try    to "UnInstall").
  341.        /S -------> CGA Snow Fence.
  342.      none -------> Pop Immediately & Run as a Normal Program.
  343.  
  344.    Item    Select Listings    are Created/Updated by TIS.BAT
  345.  
  346. -------
  347.  
  348.    The F1 Help Key produces this Display:
  349.  
  350.       <ESC> ---------> Exit This Program: Hot-Key Manuals.
  351.     
  352.       <Enter> -------> Pop Item    Select List.  <If Any>
  353.        F2 -----------> Find a Text Phrase.
  354.        F3 -----------> Find a Text Phrase.  <Ignore Case>
  355.        F4 -----------> Repeat Search.
  356.     
  357.       <Home> / <Page Up>   / <Up Arrow>    ----> Roll Upwards.
  358.       <End>  / <Page Down> / <Down Arrow> --> Roll Downward.
  359.     
  360.       <Left Arrow> --> Shift Text Left    10 Spaces.
  361.       <Right Arrow> -> Shift Text Right    10 Spaces.
  362.     
  363.       F5/F6:F7/F8 ---> Alter Colors for    This Session.
  364.        F9 -----------> Switch to a Different Text File.
  365.        F10 ----------> Report Current Color Settings.
  366.     
  367.       Any Other    Key -> Roll Down 11 Lines (Half    a Screen).
  368.  
  369. -------
  370.  
  371.    HKM retains the 4-Way scroll    and most other features    of VU, substituting 
  372. a Select List capability for VU's WildCards and    Pipes.
  373.  
  374.    HKM can operate as a    StandAlone Manual Browser or Terminate and Stay    
  375. Resident (TSR) w/ ALT-COMMA as its "Hot    Key".  When Resident, HKM will 
  376. remember your place & Jump back    there on Wake Up.
  377.  
  378.    HKM is a Public Domain Program Written in C.
  379.  
  380. ==========================================================================
  381.  
  382. >KEYS.  Report Keyboard    Hits w/    StdEK.h, Keys.h    & ScanCode.h Lookup.
  383.  
  384. Usage: Keys
  385.  
  386. Key Stroke Test.  Hit [Esc] to Exit.  Hit Any Key.
  387.  
  388.     Ascii    ScanCode    KeyMask        Keys.h        Symbol
  389.     32    57        160        32        " "
  390.     97    30        160        97        "a"
  391.     65    30        162        65        "A"
  392.     1    30        164        1        SOH
  393.     0    30        168        158        ALT_A
  394.     0    126        168        254        ALT_7
  395.     0    127        168        255        ALT_8
  396.     0    128        168        128        ALT_9
  397.     0    129        168        129        ALT_0
  398.     0    14        168        142    NewKey    ALT_BS 
  399.     0    28        168        156    NewKey    ALT_RTN 
  400.     0    133        160        133    NewKey    F11 
  401.     0    78        168        206    NewKey    ALT_PLUS    
  402.     0    166        168        166    NewKey    ALT_ENTER 
  403.     0    1        168        129    NewKey    ALT_ESC
  404.     27    1        160        27        ESC
  405.  
  406.    Above is a sample of    what Keys.com produces.     Notice    that Keys.h, 
  407. which uses the convention of ORing non-Ascii ScanCodes w/ 128 "wraps" at
  408. ALT_8, going from 255 to 128 for ALT_9.
  409.  
  410.    Usually this    fold-back causes no problem.  However, 101-Key Keyboards, an
  411. option on GSA Z-248s (which must use NewKeys.Com) and all GSA UNISYS 386s
  412. can generate the items marked "NewKey",    some of    which will collide w/ other 
  413. Keys.h style ScanCodes,    e.g., ALT_9 and    ALT_ESC.
  414.  
  415.    ScanCode.h is a straight ScanCode listing using the same symbol names as 
  416. Keys.h.     All symbols there are unique unsigned bytes.
  417.  
  418.    For Zenith Users, NewKeys.Com provides access to the    F11/F12    keys and to 
  419. some variations    on other keys, such as ALT_BS and ALT_RTN, that    IBM left out 
  420. of the original    PC's BIOS.  It also provides access to the Keypad "Grey" Keys 
  421. such as    ALT_PLUS and ALT_ENTER
  422.  
  423.    Keys    is a Public Domain program written in C.
  424.  
  425. ==========================================================================
  426.  
  427. >MSO.  Display a (Multi-Column)    List & Output User Selected Item(s).
  428.  
  429. Usage:
  430.        MSO [options] [file] ---> Present a List    & Output Selection(s).
  431.  
  432.   Note:    $Pipes are Legal in "file" Name.
  433.  
  434. Options:
  435.      /Cn ---> Specify # of Columns Displayed [n = 1-4;D:4]
  436.      /N ----> Prefix Selections w/ Item Line Numbers.
  437.      /R ----> Multiple Selections Permitted.
  438.  
  439.    MSO may be Piped In/Out w/o Disrupting List Display/Selection.
  440.  
  441.    MSO is a Public Domain Program written in C.
  442.  
  443. ==========================================================================
  444.  
  445. >PX.  A    Pipe Extensions    & Named    Pipes for DOS.
  446.  
  447. Usage:
  448.        PX [options] [Command [Arguements] or $Pipe]  --> Extend    DOS Piping.
  449.  
  450. Option Flags are Required in .BAT Files:
  451.      /A ---> Append    to Specified Pipe.
  452.      /R ---> Read From Specified Pipe.  [Force OutFlow]
  453.      /W ---> Write to Specified Pipe.
  454.  
  455. Pipes:
  456.     1. PX "Pipe    Extends" DOS stdin/stdout Pipes    using ordinary Files w/
  457.        Unusual Names.  These Names can not be Generated    by DOS.
  458.     2. A "Named" Pipe name is 1-4 Alphanumeric Characters Preceeded by '$'.
  459.  
  460. Action:
  461.     1. If InFlow Redirection, Create the Specified $Pipe ($IN is Default).
  462.     2. If a Command is Passed in, Shells Out & Execute it.
  463.     3. If InFlow Redirection, PX Quits Here.
  464.     4. If Redirected to    a File/DOS Pipe, Print Contents    of Specified $Pipe.
  465.      (Default is $OUT if found, otherwise $IN).
  466.     5. PX erases $Pipe after reading.
  467.  
  468. ----
  469.  
  470.    PX "Pipes" are just ordinary    files (as the original Unix Pipes were)    with
  471. unusual    names.    Each PX    Pipe Name begins with "$" (for you) and    "\STD "    (for
  472. DOS).
  473.  
  474.    Notice the Space.  While DOS    can handle file    names with embedded Spaces,
  475. COMMAND.COM (the command processor "Shell") can't.  In other words, these
  476. "Illegal" names    will never be generated    or used    by "normal" DOS.
  477.  
  478. ----
  479.  
  480.    PX can be used to "Extend" DOS stdin/stdout Pipes into and out of BATch
  481. Files.    There are a few    "Gotcha!'s" that DOS throws in:
  482.  
  483.    1. BATch Files can not load/unload TSRs except at the lowest    (Bootup)
  484. level.    You can    not call these files with PX.
  485.  
  486.    2. The stdout Stream    is "Junked" up by COMMAND.COM's    mindless echos and
  487. prompts.  See PXO Below    for a Solution.
  488.  
  489.    3. BATch Files will not OutFlow Pipe    unless called by PX.  DOS squirts
  490. them directly to the CRT unless    the Shell is a "Secondary" Shell (has the
  491. "/C" Option).
  492.  
  493.    4. Since DOS    doesn't    support    "Quoting" as Unix does,    PX converts BANG!
  494. character into |Pipes and 'Single' Quotes into "Doubles" as it passes your
  495. "Command Line" to the Secondary    Shell for execution.
  496.  
  497.    5. From the Command Line, PX    will figure out    what you want by how you Pipe
  498. it.  Inside .BAT Files,    the Options Flags are Required.     (Use /A anytime).
  499.  
  500.    6. Redirection of PX    to a "Character    Device"    like LPT: or NUL: can Fool PX
  501. unless the Option Flags    are Used.  (PX > NUL won't work, PX /R > NUL will).
  502.  
  503.    7. PX combs NULLs out of its    byte stream.  NULLs are    <0> after VIS.
  504.  
  505.    PX is a Public Domain program written in C.
  506.  
  507. ==========================================================================
  508.  
  509. >PXO.  A "Pipe Cap" w/ the Option to Redirect into PX Pipes.
  510.  
  511. Usage:
  512.     | PXO [$pipe] ---> BATch File PX/CRT Pipe Cap.
  513.  
  514.       If the Script is Piped out of PX,    PXO Squirts Text into "\STD OUT" or
  515.       into Specified Named Pipe.  (Name    = 1-4 Alpha-numeric Characters.)
  516.  
  517. ----
  518.  
  519.    PXO is used in .BAT files to    bypass the "Chatty" garbage DOS    throws into
  520. the Text Stream.
  521.  
  522. Examples:
  523.  
  524.    LS ---> Short List the Current DIR to stdout.
  525.    PX LS | PX |    ...  --> Dump DOS "Chatty Prompts" in the Bit Buck.
  526.  
  527.    PXO is a Public Domain program written in C.
  528.  
  529. ==========================================================================
  530.  
  531. >RSX.  Read a Single Line & Execute a Command (w/ Passed Parameters).
  532.  
  533. Usage:
  534.        RSX [/Fc] Command [Arguements] --> Do Command w/    Parameter Passing.
  535.  
  536. Options:
  537.      /Fc ---> Use 'c' as the Field Delimited vice Spaces.
  538.           The $### format for Decimal ASCII is Legal.
  539.  
  540. Action:
  541.     1. RSX reads a Single Line of Text from Stdin.
  542.     2. Using the Field Delimiter, Slots    $1-$9 are stuffed.  ($0    is the
  543.        whole Line.)
  544.     3. RSX Spawns a Sub-Shell, passing to it a "Command    Line" made up
  545.        from Passed Parameters w/ these modifications:
  546.       A. Contents of Field Slots get substitued for    $Field Tags.
  547.       B. Bangs (!) and Dits    (') become (|) & ("), respecitively.
  548.       C. $$    becomes    $.
  549.       D. DOS WildCards are Passed Unchanged.
  550.     4. RSX Repeats the Above for Until Stdin Runs Dry.
  551.  
  552. ----
  553.  
  554.    RSX uses Stdin as its "to-Do" List, so Piping into the "Command Line"
  555. requires some thought.
  556.  
  557.    For example,    Using PX works only for    the First Pass (PX erases $IN).
  558.  
  559.    If you Use PX into a    Named Pipe (say    $THIS) and begin the "Command Line"
  560. w/ "CAT    $THIS !    "  (Remember ! ==> |), each Pass will have access to the
  561. contents of that Pipe.
  562.  
  563.  
  564. ----
  565.  
  566.    The "/Fc" option allows RSX to operate on "Fields" instead of "Words".
  567.  
  568.    You can run a simple    Data Base like this:
  569.  
  570.    (one    line of    data in    file DB.DAT):
  571.  
  572.    Author: Jack    Ekwall:    Age: 45: DOB: 3    July 43: Code::6072: Phone: 1854
  573.  
  574.    TYPE    DB.DAT | RSX /F: ECHO Attn: $2 Mail Stop $8.
  575.  
  576.    Prints out:
  577.  
  578.    Attn:  Jack Ekwall Mail Stop    6072.
  579.  
  580. ----
  581.  
  582.    Notice that imbedded    spaces are preserved.
  583.  
  584.    Notice that repeated    Dlimiters are ignored ("::" is read as ":").
  585.  
  586.    You are limited to 9    fields.     ($0 is    the whole line).
  587.  
  588. ----
  589.  
  590.    RSX is a Public Domain program written in C.
  591.  
  592. ==========================================================================
  593.  
  594. >SAR.  Search & Replace in a Text Stream ala RAM-Page SAR.
  595.  
  596. Usage:
  597.       SAR "This" "That" ---> Find <This> & Substitute <That>.
  598.       SAR "This" ----------> Find <This> & Remove It.
  599.  
  600. Wild Cards:
  601.    ? --> Place Holder in <This>.  Any Character Matches.
  602.    ? Cannot Be First Character In <This>.
  603.    ? --> Place Holder in <That>.  Original Character Remains Unchanged.
  604.    $### --> An ASCII Character w/ Decimal Value <3 Digits>.
  605.    $$ --> A Single Dollar Sign.
  606.  
  607. SAR is a Filter.
  608.  
  609. ----
  610.  
  611.    SAR is a straight "This" = "That" replacement.
  612.  
  613.    "That" is allowed to contain "This" as a Sub-String.
  614.  
  615. ----
  616.  
  617.    Unlike the Unix "sed" and "awk" Tools, SAR is not Line-Oriented.  In other
  618. words, a "New Line" character is just another ASCII Byte.  SAR also allows
  619. WildCards in the "That" String, something very useful but rarely found.
  620.  
  621.    On the down side, SAR's WildCards are kind of "Whimpy" compared to Unix
  622. Regular Expressions.  SAR is more of a multi-character "tr" than a "sed".
  623.  
  624.    SAR is a Public Domain "C" Language.
  625.  
  626. ==========================================================================
  627.  
  628. >TEE.  Squirt Stdin/out    Text into a File or $Pipe.
  629.  
  630. Usage:
  631.        TEE file_name ---> Squirt Stdin/out Text    into a File.
  632.  
  633. Example: ... | TEE CON | ...  lets you (the CRT) Peek Inside a Pipeline.
  634.  
  635.   TEE a    Public Domain program written in C.
  636.  
  637. ==========================================================================
  638.  
  639. >VALVE.  A Text    Stream Flow Control Filter.
  640.  
  641. Usage:
  642.        Valve [options] [filename] --> Control Text Flow.
  643.  
  644. Options:
  645.       /An ---> Trip    on the "n"th Trigger Character.    [D:1]
  646.       /B ----> Block Text Until Triggered.
  647.       /Cc ---> Trigger on 'c' vice NL.  'c'    is any Printable.
  648.            or $$ or $### (3 Decimal Digits) for    any ASCII.
  649.       /F ----> FIFO    for Lines.  Pops Top Line Each Call.
  650.       /Hn ---> Pass    Head (Top) n Lines.  [D:10]
  651.       /I ----> Initial Character Trips.  (Ignore Everything    Else).
  652.            /C option Required.
  653.       /J ----> Jog.     (Trip Twice & Hold Initial State).
  654.       /L-----> LIFO    for Lines.  Pops Last Line Each    Call.
  655.       /Tn ---> Pass    Tail (Bottom) n    Lines.    [D:10]
  656.       /V ----> Verbose.  Echo Text to CRT Until Triggered.
  657.  
  658.    Valve defaults to a Filter.    $Pipes are Legal in filename.
  659.  
  660.    After Loading, Repeated /F or /L Calls Pop Lines until Stack/Queue
  661. is Empty.  Text    is Stored in the Named Pipe, $VALV.
  662.  
  663. ----
  664.  
  665.    Used    as a Filter, Valve does    just what the name implies, passes or blocks
  666. the Text Stream.  Default is to    pass one line of Text and then terminate.
  667.  
  668.    Using the /B    option,    Valve will block (skip)    the first line of Text and
  669. pass everything    else.
  670.  
  671.    VALVE /H is functionally equivalent to "head" in Unix.
  672.  
  673.    VALVE /H5 is    the Same as VALVE /A5.
  674.  
  675.    VALVE /T is functionally equivalent to "tail" in Unix.
  676.  
  677. ----
  678.  
  679.    The /L and /F options spill blocked text into a Buffer File instead
  680. of the "Bit Bucket".  Calling VALVE without an Inflow Pipe Pops    a Line Out of
  681. this holding area.  Try    This:
  682.  
  683.    DIR | VALVE /BA5 | VALVE /F > NUL strips the    DIR header and Stashes
  684. the Listing.
  685.  
  686.    VALVE /L > NUL Pops off the last ("bytes remaining")    line into "Ye Ole Bit
  687. Bucket".
  688.  
  689.    VALVE /F "Pops" off the DIR listing,    one line at a time until the Buffer
  690. File is    empty (returns an EOF).
  691.  
  692.    VALVE /L /A2    pulls two lines    off the    End of the Listing.
  693.  
  694.    The Buffer File is a    Named Pipe, $VALV, which may be    "Highjacked" and used
  695. as an ordinary Named Pipe.
  696.  
  697. ----
  698.  
  699.    The /Cc option changes the "Trigger"    Character from NL to 'c', some
  700. spcified character.  These "Gating" Flags pass thru unaltered EXCEPT for the
  701. one causing the    "Trigger" Action.  That    one gets gobbled.
  702.  
  703.    This    differs    from NL    "Gateing Flags"    (the Default), which are passed    or
  704. blocked    as needed to assure Text Lines stay properly delimited.
  705.  
  706. ----
  707.  
  708.    The /J (Jog)    and /I (Ignore)    Options    allow Valve to Split Out Enties    from
  709. a DataBase File    like \HELP\MANUAL.HLP (the DOS Manual).     Try This:
  710.  
  711.    MSO /N \HELP\MANUAL.LST | RSX VALVE /BA$1 /JI /C$$62    \HELP\MANUAL.HLP
  712.  
  713.    Notice that Options can be in Any Order & can be Combined ala Unix Flags.
  714.  
  715. ----
  716.  
  717.    The /V option is useful during DeBugging.
  718.  
  719.     VALVE is a Public Domain program written in    C.
  720.  
  721. ==========================================================================
  722.  
  723. >VU.  A    "README" style file browser ala    Unix "more" w/ PX Pipes.
  724.  
  725. Usage:
  726.        VU [options][drive:][path]filename [, ...] --> View Text    Files.
  727.      | VU [options] ---> View a    Text Stream ala    MORE.
  728.  
  729. Options:
  730.        /A -------------> Query for Initial Search.
  731.        /C0xhhhhhh -----> Specify Colors.   [D:/C0x0F1F0E]
  732.        /K -------------> Pop w/    Select List.
  733.        /F \"FindMe\" ----> Jump    to Text    Match.
  734.        /R -------------> Honor RAM-Page    Tables.
  735.        /S -------------> CGA Snow Protection.
  736.  
  737.   Named    Pipes are Legal.  Pipes    are NOT    Errased    by Viewing.
  738.  
  739. ----
  740.  
  741.    VU is "MORE"    w/ 4-Way Scrolling via Arrow Keys, Searches w/ Repeat &
  742. Ignore-Case Options, and PopUp Help on F1.
  743.  
  744.    VU can be Fully Piped w/o Lockups, will Display a List of Files or the 
  745. InFlow from Stdin.
  746.  
  747.    The /C option accepts a Hexadecimal Integer such as 0x1F301E, where "1F" 
  748. sets the Text to "Bright White on Blue", "30" sets the Bars to "Black on 
  749. Auqa" and "1E" shows Underlined    Text in    Yellow on Blue.     
  750. (See DOS Colors    above for details).
  751.  
  752.    The User can    alter the Colors for the current session via F10.  If a    
  753. combination is pleasing, F10 will also report the equivalent /C    option.
  754.  
  755.    VU is the Display Engine for    TIS.BAT, which is the "Business    End" of    MAN, 
  756. HELP and TERMS.
  757.  
  758.    VU is a Public Domain program written in C.
  759.  
  760. ==========================================================================
  761.  
  762.