home *** CD-ROM | disk | FTP | other *** search
- =======================================================================
-
- slash.doc documentation file for slash.zip to form slash2.zip
-
- ----------------------------------------------------------------------
- SLASH and SWITCH, within limits, allow the DOS switch character to be
- changed to "dash", allowing "slash" to be used as a directory
- separator. If you still use command.com as a shell, you will
- unfortunately not realize the full benefit.
-
- BEFORE: d:\path\xyz /a /b /c
- AFTER: d:/path/xyz -a -b -c
-
- ----------------------------------------------------------------------
- TYPICAL USE IN AUTOEXEC.BAT (more detailed explanation below)
- ....
- [[command /c] loadhigh] d:\path\slash (NOT REQUIRED BEFORE DOS 5)
- switch -
- ....
- ----------------------------------------------------------------------
-
- NOTE: slash2.zip is identical to slash.zip EXCEPT for the addition of
- this doc file - the sources and executables are unchanged.
-
- =======================================================================
-
- WHAT THESE PROGRAMS WILL DO FOR YOU.
-
- With the exceptions noted, and others I'll probably soon hear about,
- these routines will allow DOS users to change the command-line-option
- "switch character" from "slash" to "dash" (or anything else), allowing
- "slash" to be used [interchangeably with "back-slash", as it turns out]
- for pathname (subdirectory) delimiters. For UNIX users, this will make
- life under DOS more tolerable.
-
- =======================================================================
-
- WHAT THESE PROGRAMS WILL NOT DO FOR YOU.
- ^^^
- 1. Most annoying, unless you have switched to 4DOS or MKS-Toolkit or
- someone else's replacement for Microlimp's COMMAND.COM shell, the
- BUILT-IN functions (e.g. DIR) will NOT accept the change! (If you're
- reading this, why aren't you using something better than DIR anyway?)
- Although this will understandably make you want to drop the whole idea,
- you should instead look at it as incentive to examine these shell
- alternatives and all the other benefits they bring. 4DOS (commercial
- shareware available from simtel and clone sites) offers vastly improved
- DOS and enough hooks to make DOS look almost like UNIX; MKS offers the
- UNIX korn-shell. I strongly endorse both but will try to refrain from
- editorializing excessively.
-
- 2. For inflexible programs which do their own "hard wired"
- command-line parsing (rather than testing through DOS or the bios - I'm
- not entirely certain WHO intercepts the command line and passes out
- parameters), you're stuck with d:\sub\direct\file /option. In the
- literature, you will usually find such programs referred to as "not
- well behaved" or "brain-dead", depending on the strength of the
- author's prejudice. As stated above, most important of these is
- COMMAND.COM and its built-in functions. But FORMAT is another
- annoying example. One solution is, upon getting the "Parse Error 9"
- message, mutter some observations about the ancestry of the program's
- originator, and re-enter the command using / instead of -. Alternately,
- "batch it" as the next paragraph suggests.
-
- 3. Programs using '-' as part of the program name (e.g. xyz-ab.com or
- 00-index.txt) will be awkward to call because the '-' gets intercepted;
- your operating system will probably look for what preceded it as a
- file name and what followed it as an option. Usually this results in
- "File xyz not found" or similar error messages. Depending on who's
- doing your parsing, you may fool it with a wild character (e.g. "list
- 00?index.txt"). Frequently, the easy solution is to rename the file,
- perhaps using '_' (underbar) instead of '-'. If the program is part of
- a package in which it gets itself called from WITHIN another program
- however, this causes pain. The reckless will wade in with binary
- editors and change the executables. The rest of us will solve the
- problem by creating a three-line batch file (or alias if you have the
- capability) as outlined below: to unmodify the switch char back to '/';
- execute the desired program; and remodify switch to '-'.
-
- EXAMPLE BATCH FILE:
-
- : c:/bin/XXX.BAT (optionally XXX.BTM if using 4DOS)
- switch /
- c:\dos\xyz /x /y /z
- or, to feed parameters from the command line, this should work;
- c:\dos\xyz %1 %2 %3
- switch -
-
- =======================================================================
-
- HOW DID WE GET HERE?
-
- Borrowing (with permission) from the MKS manual page for their SWITCH,
- "... Within DOS there is a system-defined option delimiter character,
- which most DOS commands use to recognize command line options. DOS
- sets this delimiter initially to the / character.... However, UNIX
- convention is to signal options with the - (dash) character....to allow
- / to be used as a pathname delimiter...." For a variety of reasons,
- not the least of which is the desire of UNIX users to make their PC's
- more UNIX-like, this has also grown in popularity in the DOS world.
-
- A pair of undocumented "features" before DOS Ver 5 made this more or
- less painless. First, for some reason, DOS has ALWAYS accepted both
- '\' and '/' in path names. But it first intercepted '/' to be used for
- the switch character, so the fact that it could have been used as
- directory separator was moot. However, the hooks were there, and
- somebody (several somebodies, actually) discovered that the interrupt
- call which fielded this could be fed a parameter to change the switch
- character, and SWITCH (from several sources) was born. MKS provides
- one in their TOOLKIT. Their switch(1) manual page does warn,
- "switch(1) uses an undocumented function call... A few DOS commands
- ignore the system option delimiter... [and] many popular DOS software
- packages also ignore the system option. As of DOS 4.0, standard DOS
- commands ignore the system option delimiter."
-
- Then came DOS 5. Microlimp had removed the undocumented feature!
- SWITCH no longer did its thing! But another someone (I've been unable
- to determine authorship) created SLASH, a 100-byte TSR program to
- intercept Interrupt 21 and essentially re-implement the old
- undocumented feature. SWITCH then worked as before. As outlined
- above, we still live in an imperfect world, but at least those of us
- who got used to having a UNIX-like DOS can have it again. In all
- honesty, without SLASH I'd have given serious thought to going back to
- DOS 4, even with all its monstrous memory management machinations. For
- what it's worth, rumor has it that DR-DOS 6 does NOT include the MS-DOS
- 5 disimprovement, although I have not verified this.
-
- SLASH gets loaded once, usually as the early example shows. SWITCH
- gets called then, and/or whenever one wishes. If called without
- parameters, it reports the current switch character.
-
- : AUTOEXEC.BAT
- ...
- : Install SLASH as a tsr.
- d:\path\slash
- or, if you want to put it up in the HMA (high memory area);
- loadhigh d:\path\slash
- or, if command.com is NOT your shell;
- d:\path\command /c loadhigh d:\path\slash
- or, if command.com is NOT your shell (but is in your path);
- command /c loadhigh d:\path\slash
-
- d:\path\switch -
- ...
-
- ========================================================================
- CREDIT WHERE CREDIT IS DUE:
-
- I did not create these routines and can take credit and/or blame only
- for the slash.doc file. SLASH.ZIP was emailed to me by
-
- Industrial Poet <mathew@mantis.co.uk>
-
- and I am exceedingly grateful. I realize that those of you who have
- not switched from command.com to something better will not feel as
- enthusiastic as I, but SLASH was my answer to a really desperate
- prayer. I hope you profit similarly.
-
- don
- ---------------------------- signature of the day -------------------------
- Don Malpass [ malpass@ll.mit.edu ], [ LL-internal: malpass@spenser ]
- How do I know he is going into politics? Even when I finish
- talking to him on the PHONE my wallet is gone! (Al Oppenheim)
-