------------------------------

GCOM version 0.85

  Roberto Gordo Saez
  <rogs@iname.com>
  <kernel9000@yahoo.com>

------------------------------

WHAT IS GCOM?

This is the short answer:
GCOM is a shell for DOS. It can be used as a replacement for command.com on
MSDOS or other compatible DOS.

And this is the story:
The project started several months ago, when i was trying to make a small,
simple and efficient shell for FreeDOS. (FreeDOS is a project for making a
complete free DOS, compatible with MSDOS: http://www.freedos.org/).

At that time FreeDOS was (and still is) using FreeCOM: another shell with
many features, which is bigger, more difficult to maintain and loaded with
lots of bugs. Because that, i began to make my own shell with different goals
in mind. [Maybe someone still remember my comments on the FreeDOS's mail
list..]


WHAT HAPPENED NEXT?

Well, many other projects appeared and i was getting less and less free time
for GCOM, which was almost abandoned into my hard disk with the hope that
sometime i would have again the time for finishing it. But the time goes and
i have more and more occupations; now i have a (remunerated) job, and now it
is less probable that i will ever finish GCOM.

For this reason i have taken the decision to rescue the most part of my
previous work and release it with the hope it will be useful for someone.


WHAT IS THE CURRENT STATE?

Although GCOM is not finished, it is quite usable. There are features that
are not implemented, but those that are finished work very well without
(known) bugs.

The features are:

 - GCOM is small, only those commands that need to be internal are internal,
   or those that are simple.
 - GCOM is easy to maintain.
 - Supports input and output redirection with "<" and ">".
 - Supports data flow redirection in command with "|".
 - It can execute BAT files.
 - Redirection work perfectly inside a BAT file (contrary to the command.com
   of MSDOS).

The internal commands that work are:

 BEEP
 BREAK [ON|OFF]
 CALL file
 CD [dir]
 CHDIR [dir]
 ECHO [ON|OFF]
 ECHO text
 ECHO.[text]
 EXIT [number]
 PATH [text]
 PAUSE [text]
 PROMPT [text]
 REM [text]
 SET [variable[=[text]]]
 SHIFT
 UNSET variable
 VER [/X]
 VERIFY [ON|OFF]

All other commands must be external, with the exception of GOTO, IF and FOR,
which are not implemented (this is probably the most noticeable missing of
GCOM).

The missing features:

 - The GOTO, IF and FOR commands.
 - Device files "AUX", "CON", etc. This should be quite easy to implement.
 - Intensively testing in search for some hidden bug.
 - It would be good to write the external commands. (I've actually started
   to do this, if you are interested in the sources send me an e-mail
   message).
 - Write better error and break handlers.

If you want to use GCOM it will be very useful for you to get and install a
set of external commands, such as DIR, DEL, ATTRIB, CLS, TYPE...
You can download them from:

http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/
http://www.simtel.net/pub/simtelnet/gnu/gnuish/dos_only/
http://www.simtel.net/pub/simtelnet/gnu/gnuish/dos_only/fut312bx.zip


THE AUTHOR NOTE.

I (Roberto Gordo Saez) am the author of GCOM, but i've taken ideas and bits
of code from the sources released in DOSC by Pasquale J. Villani; so, the
copyright belongs to both persons.

GCOM is under the GNU General Public License, version 2 or later.

Although GCOM development is stopped for now, you can still send to me your
patches and changes if you want. I'll make a new release some day if there
are enough changes. Also read the next section for a best knowledge of what
is needed and what is not.

If you want to make a big program with lots of options and many internal
commands and features, maybe is better for you to join the FreeCOM project
(http://freedos.sourceforge.net). I've made GCOM intentionally small... but
anyway i would be happy to to see any project that is made from GCOM.


NOTES AND EXAMPLES.

GCOM always FAIL when an error is handled by the critical error handler. I
saw that FreeCOM ask the user the questions "Abort, Retry, Ignore?" or
similar, but the use of interrupts inside the handler is not a good idea.
Because standard error is not available inside the interrupt handler, if the
output is redirected the error message will be redirected too, and the user
will never know what happened. For example:

DIR A: > LIST.TXT

If there are no disk in drive A, the system will never return to a stable
state with FreeCOM. I've choosen best the "always return fail" solution: the
previous command would return an error message and finish; the user can
execute it again when there is a disk in the drive A. Another solution would
be to use the BIOS for asking the user; this is probably what is done in the
MSDOS's command.com.
----

Redirection inside a BAT file works perfectly with GCOM. I personally
consider that this is a bug of MSDOS's command.com, and i do not want to
emulate the bugs. For example, we have a BAT file with the name FOO.BAT and
this content:

@ECHO HELLO > MESSAGE.TXT
@ECHO BYE

Now we type:

FOO > OUTPUT.TXT

The file MESSAGE.TXT will be created with the string "HELLO" and the file
OUTPUT.TXT will contain the string "BYE". Also works OK when you call a BAT
file inside another BAT file, and combine the redirection in all posible
weird ways.
----

GCOM detects all (i hope) syntax faults in the command line, specially with
the redirection, for example:

TYPE TEXT.TXT > < FCH
TYPE TEXT.TXT > FCH |
TYPE TEXT.TXT |> FCH
| TYPE TEXT.TXT
TYPE TEXT.TXT > FCH1 > FCH2
DIR | | SORT
DIR | >CWD.TXT | SORT
< INPUT.TXT | SORT

And many others.
----

The commands "ECHO" and "ECHO." keep all space between words and at the
beginning of the text, exactly like MSDOS's shell does. For example:

C:\> ECHO This   is  a  phrase with  random spaces
This   is  a  phrase with  random spaces

C:\> ECHO.TEXT
TEXT

C:\> ECHO.     TEXT
     TEXT
----

The internal commands in MSDOS's command.com can be separated with a
character that can not be in the command itself. It should be not very
difficult to implement this, but this is a weird feature of MSDOS that i do
not like, and therefore i have not implemented it. For example, the commands:

CD\TEMP
CD..
ECHO;HELLO
ECHO=
ECHO,X

Will work with MSDOS's command.com, and will not work with GCOM because i
think this stuff is a big crap. However, the command "ECHO." will work,
because i've made a special command with that name useful for echoing an
empty line and the reserved values ON and OFF.
----

All errors in the command line length after expansion of variables in a BAT
file are detected and reported. I believe all other problems are always
detected as well.

External commands can be executed by their relative or absolute path, or
searched in the PATH variable when no specified, like MSDOS's command.com.
For example:

EDIT README.TXT
..\GAMES\DOOM\DOOM
\DOS\EDIT NOTE.TXT
A:\UNZIP SRC.ZIP
----

The command ECHO can be ON or OFF, but unlike MSDOS's shell it is a global
variable. If you type ECHO OFF in the command line, this setting will be used
in all BAT files unless this value is changed from inside.
----

GCOM is not perfect because it is not finished; it lacks the optimization
phase and it may have hidden bugs, but i hope it is good enought and can be
used without problems.

There are MANY other particular features that i do not remember now... try to
find them yourself. And have a lot of fun.
