Menu

Tree [267579] master /
 History

HTTPS access


File Date Author Commit
 dos9 2020-06-04 TSnake41 TSnake41 [267579] Fix mod deadlock when there is a module loaded.
 dos9ize 2018-05-12 Romain GARBI Romain GARBI [d259a0] Little fixs to build system
 dump 2018-12-17 TSnake41 TSnake41 [f64a34] Make dos9 /? and dump /? output more consistent.
 libDos9 2018-12-27 Romain GARBI Romain GARBI [3a013e] Fixed recursive file search under Linux and non...
 libcu8 2018-08-26 Romain GARBI Romain GARBI [11fdda] Fixed a bug with history completion
 libinteval 2020-06-01 Romain GARBI Romain GARBI [12c081] Fixed double declaration inside libInteval code
 libmatheval 2018-12-15 Romain GARBI Romain GARBI [efdd70] Fixes to SET /a:f command handling of spaces
 man 2018-12-27 Romain GARBI Romain GARBI [8727e6] Added documentation for BATBOX module. Modified...
 modules 2018-12-13 Romain GARBI Romain GARBI [c9a316] Fixed batbox modules colors to make them portable.
 po 2018-12-17 TSnake41 TSnake41 [f64a34] Make dos9 /? and dump /? output more consistent.
 scripts 2020-06-02 TSnake41 TSnake41 [89b411] Use cd /d instead of cd in hlp
 tea 2018-08-04 TSnake41 TSnake41 [eadc76] Fixed some warnings
 tests 2018-07-07 Romain GARBI Romain GARBI [c65830] Added an experimental test suite
 .gitignore 2018-12-15 TSnake41 TSnake41 [ebf7cf] Updated .gitignore
 BUILD.readme 2018-11-29 Romain GARBI Romain GARBI [269751] Fixed outdated text files.
 COPYING 2016-01-24 Romain GARBI Romain GARBI [a2cd3d] Better support for libcu8, some bugfixes and ad...
 COPYING.darkbox 2018-12-14 TSnake41 TSnake41 [1b6522] Updated darkbox copyright
 COPYING.libmatheval 2018-05-12 Romain GARBI Romain GARBI [f1ea54] Changed build system to makefiles based on http...
 COPYING.linenoise 2018-06-11 Romain GARBI Romain GARBI [2475d8] Added line-editing capabilities for Unix compat...
 GUIDELINES.md 2018-12-27 Romain GARBI Romain GARBI [8727e6] Added documentation for BATBOX module. Modified...
 GUIDELINES.tea 2018-12-27 Romain GARBI Romain GARBI [8727e6] Added documentation for BATBOX module. Modified...
 Makefile 2020-06-04 TSnake41 TSnake41 [d3f60a] Fixed pushd memory leak and DirStack rework.
 README.md 2018-12-27 Romain GARBI Romain GARBI [8727e6] Added documentation for BATBOX module. Modified...
 README.tpl 2018-12-27 Romain GARBI Romain GARBI [8727e6] Added documentation for BATBOX module. Modified...
 THANKS.md 2018-11-29 Romain GARBI Romain GARBI [d920aa] Fix THANKS file to mention Xenoxis' effort to c...
 THANKS.tea 2018-11-29 Romain GARBI Romain GARBI [d920aa] Fix THANKS file to mention Xenoxis' effort to c...
 WHATSNEW.md 2020-06-04 TSnake41 TSnake41 [267579] Fix mod deadlock when there is a module loaded.
 WHATSNEW.tea 2020-06-04 TSnake41 TSnake41 [ed6ba6] Update WHATSNEW.tea
 build-mingw.sh 2018-08-04 TSnake41 TSnake41 [eadc76] Fixed some warnings
 config.c.in 2018-06-15 Romain GARBI Romain GARBI [e21b44] Fixed unneeded error messages
 config.h.in 2018-11-27 TSnake41 TSnake41 [68192b] Make modules feature optionnal, fixed few build...
 config.mk 2018-11-27 TSnake41 TSnake41 [522560] Add PIC flag checking, fix build.
 femto.mk 2018-12-08 TSnake41 TSnake41 [b7df9b] Improved femto and dump command building, fixed...

Read Me

Quick starting guide

Dos9 is a open source command prompt meant to implement a superset of
cmd.exe script language (known as batch by most devellopers). It is
designed to be as simple to use as possible, reliable, portable and
lightweight.

Getting started with Dos9

Firstly, if you have never used cmd or an equivalent interpreter before, you
should definitely consider reading a tutorial about batch programming. On the
other hand if you are already familiar with batch, just open Dos9 and
start typing some commands ! Dos9 batch dialect is almost compatible with cmd.

If you use Dos9 on windows, the only file extension provided is .dos9 by
default (to avoid trashing your OS with potential conflicts). However,
calling a .bat or .cmd script from inside Dos9, leads them to get
executed by Dos9.

Dos9 changes

Once installed, it is quite straightforward to play with Dos9, especially if
you are quite familiar with cmd. However, there is a couple of thing out there
you have to know about.

On one hand, there is a couple of differences between Dos9 and cmd :

  • The HELP system is different from the original cmd help system. On the
    first time you run the command, you need to genérate the whole documentation
    using:
    help /b
    

Once all the data has been generated you can use it as the help command,
but beware, it's fairly improved.

  • There is a few FOR modifications:

  • Empty line are processed by FOR /F. This behaviour can be disabled
    using:

        SETLOCAL EnableCmdlyCorrect
    
  • Multiples lines can be used as input for FOR /F.

  • Tokens can be specified in reverse order and can also overlap without bug.

  • Some undocumented but useful variables from cmd are still lacking (Though
    %=EXITCODEASCII% is now supported).

  • Dos9 has no inconsistencies with escaped characters with ^, it requires
    only one escape.

  • DIR /b does not automatically return absolute paths.

  • Support of START is a bit tricky under some platforms and some of the
    options or the whole command might not be provided depending on your system
    configuration if you use *nix.

On the other hand, Dos9 also provides you with with a bunch of extensions:

  • A full set of extensions to support floating points arithmetics through
    SET and IF:

  • A new SET /a:f command to perform operations on floating point
    numbers.

  • New comparisons like FEQ or FNEQ for the IF command to compare
    floating-point numbers.

  • The ground-breaking possibility to specify logical expressions using
    AND and OR and the new IF extensions, like in the following
    example:

    IF [ [ !ok! EQU 1 ] and [ defined file ] ] (
     :: some code 
    )
    
  • A module system allowing extension loading at run-time. This offer numbers
    of possibilities from graphical user interfaces to networking extensions.
    Currently, the only module provided is the BATBOX module.

  • To speed up parsing, Dos9 loads files entirely in memory at startup. If the
    file gets modified during its execution, it is reloaded and Dos9 restarts on
    the next line (counting lines from the begining). This can also be
    disabled using:

    SETLOCAL EnableCmdlyCorrect
    
  • As can be seen in the previous code, ::-style comments can be used
    inside blocks.

  • All the FOR modifications described above.

  • Enhanced GOTO and CALL that can use a file and a label at the same
    time and ignore errors:

    GOTO :mylabel myfile.bat /Q
    CALL /e :mylabel myfile
    
  • Extended HELP providing search capabilities and help in various formats
    including HTML.

  • The new command ALIAS allowing to set up simple and fast aliases for the
    commands:

    ALIAS dbs=dir /b /s
    
  • An extension to the FIND command to use simple regular expressions:

    echo match my regular expression | FIND /e "match * regular expression"
    
  • The FIND and MORE commands are provided as internal commands.

  • New internal commands XARGS and WC inspired from their *nix
    counterparts:

  • XARGS runs a command taking command parameters on the standard input.

  • WC counts line or words or bytes in a file.

        :: Count lines in subdirs 
        dir /s /b /a:-D . | xargs wc /l
    
  • New external command DUMP to dump hexadecimal code.

  • New SHIFT extensions and new %+ variable containing the remaining
    arguments.

Troubleshooting

Dos9 supports only two languages yet (french and english). If you
cannot see the messages translated, please check the value of the LANG and
LANGUAGE environment variables and set them appropriately.

If you have some questions about or need some help with Dos9, please feel free
to join Dos9's official discord at:
https://discord.gg/w4KtdCv

What's in this folder ?

There is a few interesting things in this directory that you might need:

  • BUILD.readme : A text file describing how to build dos9

  • WHATSNEW : A log of the changes made to Dos9

  • THANKS : A list of all the contributors to the project.

  • GUIDELINES : A text files giving guidelines on how to
    modify Dos9.

  • COPYING.* : The license of the project and of projects used by Dos9.