home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / SYSTEM / SLASH2.ZIP / SLASH.DOC < prev    next >
Encoding:
Text File  |  1992-04-22  |  7.8 KB  |  164 lines

  1. =======================================================================
  2.  
  3. slash.doc    documentation file for slash.zip to form slash2.zip
  4.  
  5. ----------------------------------------------------------------------
  6. SLASH and SWITCH, within limits, allow the DOS switch character to be
  7. changed to "dash", allowing "slash" to be used as a directory
  8. separator.  If you still use command.com as a shell, you will
  9. unfortunately not realize the full benefit.
  10.  
  11. BEFORE: d:\path\xyz /a /b /c
  12. AFTER:  d:/path/xyz -a -b -c
  13.  
  14. ----------------------------------------------------------------------
  15. TYPICAL USE IN AUTOEXEC.BAT    (more detailed explanation below)
  16. ....
  17. [[command /c] loadhigh] d:\path\slash    (NOT REQUIRED BEFORE DOS 5)
  18. switch -
  19. ....
  20. ----------------------------------------------------------------------
  21.  
  22. NOTE:  slash2.zip is identical to slash.zip EXCEPT for the addition of
  23. this doc file - the sources and executables are unchanged.
  24.  
  25. =======================================================================
  26.  
  27. WHAT THESE PROGRAMS WILL DO FOR YOU.
  28.  
  29. With the exceptions noted, and others I'll probably soon hear about,
  30. these routines will allow DOS users to change the command-line-option
  31. "switch character" from "slash" to "dash" (or anything else), allowing
  32. "slash" to be used [interchangeably with "back-slash", as it turns out]
  33. for pathname (subdirectory) delimiters.  For UNIX users, this will make
  34. life under DOS more tolerable.
  35.  
  36. =======================================================================
  37.  
  38. WHAT THESE PROGRAMS WILL NOT DO FOR YOU.
  39.                          ^^^
  40. 1.  Most annoying, unless you have switched to 4DOS or MKS-Toolkit or
  41. someone else's replacement for Microlimp's COMMAND.COM shell, the
  42. BUILT-IN functions (e.g. DIR) will NOT accept the change!  (If you're
  43. reading this, why aren't you using something better than DIR anyway?)
  44. Although this will understandably make you want to drop the whole idea,
  45. you should instead look at it as incentive to examine these shell
  46. alternatives and all the other benefits they bring.  4DOS (commercial
  47. shareware available from simtel and clone sites) offers vastly improved
  48. DOS and enough hooks to make DOS look almost like UNIX; MKS offers the
  49. UNIX korn-shell.  I strongly endorse both but will try to refrain from
  50. editorializing excessively.
  51.  
  52. 2.  For inflexible programs which do their own "hard wired"
  53. command-line parsing (rather than testing through DOS or the bios - I'm
  54. not entirely certain WHO intercepts the command line and passes out
  55. parameters), you're stuck with d:\sub\direct\file /option.  In the
  56. literature, you will usually find such programs referred to as "not
  57. well behaved" or "brain-dead", depending on the strength of the
  58. author's prejudice.  As stated above, most important of these is
  59. COMMAND.COM and its built-in functions.  But FORMAT is another
  60. annoying example.  One solution is, upon getting the "Parse Error 9"
  61. message, mutter some observations about the ancestry of the program's
  62. originator, and re-enter the command using / instead of -.  Alternately,
  63. "batch it" as the next paragraph suggests.
  64.  
  65. 3.  Programs using '-' as part of the program name (e.g. xyz-ab.com or
  66. 00-index.txt) will be awkward to call because the '-' gets intercepted;
  67. your operating system will probably look for what preceded it as a
  68. file name and what followed it as an option.  Usually this results in
  69. "File xyz not found" or similar error messages.  Depending on who's
  70. doing your parsing, you may fool it with a wild character (e.g. "list
  71. 00?index.txt").  Frequently, the easy solution is to rename the file,
  72. perhaps using '_' (underbar) instead of '-'.  If the program is part of
  73. a package in which it gets itself called from WITHIN another program
  74. however, this causes pain.  The reckless will wade in with binary
  75. editors and change the executables.  The rest of us will solve the
  76. problem by creating a three-line batch file (or alias if you have the
  77. capability) as outlined below: to unmodify the switch char back to '/';
  78. execute the desired program; and remodify switch to '-'.
  79.  
  80. EXAMPLE BATCH FILE:
  81.  
  82. : c:/bin/XXX.BAT (optionally XXX.BTM if using 4DOS)
  83. switch /
  84. c:\dos\xyz /x /y /z
  85.     or, to feed parameters from the command line, this should work;
  86. c:\dos\xyz %1 %2 %3
  87. switch -
  88.  
  89. =======================================================================
  90.  
  91. HOW DID WE GET HERE?
  92.  
  93. Borrowing (with permission) from the MKS manual page for their SWITCH,
  94. "... Within DOS there is a system-defined option delimiter character,
  95. which most DOS commands use to recognize command line options.  DOS
  96. sets this delimiter initially to the / character....  However, UNIX
  97. convention is to signal options with the - (dash) character....to allow
  98. / to be used as a pathname delimiter...."  For a variety of reasons,
  99. not the least of which is the desire of UNIX users to make their PC's
  100. more UNIX-like, this has also grown in popularity in the DOS world.
  101.  
  102. A pair of undocumented "features" before DOS Ver 5 made this more or
  103. less painless.  First, for some reason, DOS has ALWAYS accepted both
  104. '\' and '/' in path names.  But it first intercepted '/' to be used for
  105. the switch character, so the fact that it could have been used as
  106. directory separator was moot.  However, the hooks were there, and
  107. somebody (several somebodies, actually) discovered that the interrupt
  108. call which fielded this could be fed a parameter to change the switch
  109. character, and SWITCH (from several sources) was born.  MKS provides
  110. one in their TOOLKIT.  Their switch(1) manual page does warn,
  111. "switch(1) uses an undocumented function call... A few DOS commands
  112. ignore the system option delimiter...  [and] many popular DOS software
  113. packages also ignore the system option.  As of DOS 4.0, standard DOS
  114. commands ignore the system option delimiter."
  115.  
  116. Then came DOS 5.  Microlimp had removed the undocumented feature!
  117. SWITCH no longer did its thing!  But another someone (I've been unable
  118. to determine authorship) created SLASH, a 100-byte TSR program to
  119. intercept Interrupt 21 and essentially re-implement the old
  120. undocumented feature.  SWITCH then worked as before.  As outlined
  121. above, we still live in an imperfect world, but at least those of us
  122. who got used to having a UNIX-like DOS can have it again.  In all
  123. honesty, without SLASH I'd have given serious thought to going back to
  124. DOS 4, even with all its monstrous memory management machinations.  For
  125. what it's worth, rumor has it that DR-DOS 6 does NOT include the MS-DOS
  126. 5 disimprovement, although I have not verified this.
  127.  
  128. SLASH gets loaded once, usually as the early example shows.  SWITCH
  129. gets called then, and/or whenever one wishes.  If called without
  130. parameters, it reports the current switch character.
  131.  
  132. : AUTOEXEC.BAT
  133. ...
  134. :  Install SLASH as a tsr.
  135. d:\path\slash
  136.      or, if you want to put it up in the HMA (high memory area);
  137. loadhigh d:\path\slash
  138.      or, if command.com is NOT your shell;
  139. d:\path\command /c loadhigh d:\path\slash
  140.      or, if command.com is NOT your shell (but is in your path);
  141. command /c loadhigh d:\path\slash
  142.  
  143. d:\path\switch -
  144. ...
  145.  
  146. ========================================================================
  147. CREDIT WHERE CREDIT IS DUE:
  148.  
  149. I did not create these routines and can take credit and/or blame only
  150. for the slash.doc file.  SLASH.ZIP was emailed to me by
  151.  
  152.       Industrial Poet <mathew@mantis.co.uk>
  153.  
  154. and I am exceedingly grateful.  I realize that those of you who have
  155. not switched from command.com to something better will not feel as
  156. enthusiastic as I, but SLASH was my answer to a really desperate
  157. prayer.  I hope you profit similarly.
  158.  
  159.     don
  160.  ---------------------------- signature of the day -------------------------
  161.    Don Malpass   [ malpass@ll.mit.edu ],  [ LL-internal: malpass@spenser ]
  162.   How do I know he is going into politics?  Even when I finish
  163.      talking to him on the PHONE my wallet is gone!     (Al Oppenheim)
  164.