Read Mode
Default

DOS9: A Free Command Prompt Batch Alternative By DarkBatcher

Batch Code on Windows is a largely useful coding language, as we certainly think here at TheBATeam. However, it can have limitations. It's easy to learn with a low number of commands and little changes over time, it's easy to run and easy to share. However, these capabilities come at a price. 

DOS9: A Free Command Prompt Batch Alternative | By DarkBatcher

DOS9: A Free Command Prompt Batch Alternative | By DarkBatcher

Batch Code has little to no error handling, it is nearly impossible to encrypt, and it only works on Windows operating systems. It also can slow down when running complicated algorithms and for loops. These are problems that today's tool, DOS9, are trying to solve.

What is DOS9?

DOS9 is an open Batch code alternative written by Romain Garbi and Teddy Astie, that offers many features that any batch coder will appreciate. It is a free batch interpreter which can not only run on Windows but also on any Unix OS. 

DOS9: A Free Command Prompt Batch Alternative | By DarkBatcher
Dos9: Preview in Windows 10
On top of that it is portable, it can run off of a flash drive, and outruns the Command Prompt on speed any day, especially on Unix systems. It supports most if not all batch commands and even offers advanced support for calling files or labels. 
You can even call a specific label in a specific file.
These features can allow you to give your batch codes the functionality of plugins and custom call files! It also supports floating-point arithmetic, something that batch code fails at dramatically. DOS9 even enhances the FOR Command. Other contributors to DOS9 have also made their own extensions for DOS9 to further enhance your Command Prompt Experience.

Dos9 Features:

One of my favorite features of DOS9 is that it is more consistent with batch files. You don't have to rearrange your variables to switch from batch file to direct console input. For instance, for loops use %%A in the console just like in a batch file. What about using it on Unix systems? It's fairly easy to install it on your Unix systems. The command by command instructions can be found on the DOS9 website: www.dos9.org/download.

What are some of the key commands unique to DOS9?

  • The FOR Command has one amazing change, it now processes empty lines instead of ignoring them. The Command Prompt's IF command does not handle empty lines. This feature is classified as an unfixed bug, and nobody wants it, since it causes huge problems with line counting and such.
  • Parentheses are handled differently on the console. When you enter a parenthesis `(` and press return, it will start a new line and wait for an end parenthesis. This allows you to enter in whole Complicated FOR loops into just the console for testing.
  • Floating numbers can be processed with the set /a:f command.
  • GOTO and CALL can use a file and label at the same time. Example: GOTO :mylabel :myfile.bat or CALL /e :mylabel myfile. This allows you to have function files you can call from within another script.
  • The Alias command allows you to set up aliases for commands. For instance, if you are used to using the ls command from unix, you can run this command: Alias ls=dir /b /s 

  • To run a command taking command parameters on the standard input you can run the xargs command. You can combine that with the wc command to count lines, words, or bytes in a file. Example: dir /s /b /a:-D . | xargs wc /l 
  • There is also the TEA command. This command does not brew you tea, but can do something just as useful. It can quickly pre-process text for you. 
  • Great error handling where the window doesn't close on the first sign of trouble.
  • Multiple language support. It supports English, French, and Mandarin. (And Now, Hindi also in version 218.2 and above) 

Some Limitations of DOS9 Project:

Those are just some of the many extra features DOS9 adds to your default Command Prompt. However, DOS9 is not all roses and chocolates, there are some downsides to this alternative processor. For instance, it does not support setting local environments with SETLOCAL.  (Fixed in 218.2 and above)

It also can be buggy when setting it up, and has numerous typos that still need to be fixed. You can run into trouble if you have scripts that compensate for the original command prompt's common shortcomings, as they will end up causing trouble with the fixed DOS9 environment.


From Editor's Desk:

All in all I would very much recommend DOS9. It is a great tool to mess around with, and although it is not quite ready to fully replace Windows's built in CMD, its getting there. You can check out the project at www.DOS9.org. It can also be found on SourceForge and on Wikipedia, though the Wikipedia page is in french. So go check it out and tell us what you think in the comments below.

Written by:
Lukaka 2018 with TheBATeam (www.TheBATeam.org)
SetLucas EnableDelayedExpansion

Sources:
https://www.dos9.org/doc

No comments:

Powered by Blogger.