[OS/2 e-Zine! - Now on CD (Click here).]

4OS2 3.01A- by Lief Clennon

Summary:JP Software's OS/2 equivalent of its famous 4DOS product manages to keep all the power its DOS product has, plus take advantage of OS/2's strength too.

4OS2 is, in a way, unique among the products being reviewed this week: of the various command shells available for OS/2, only 4OS2 is a complete replacement for the CMD.EXE supplied by IBM. YAOS/2 overlays CMD and can't run without it, and while the various Unix shells stand alone, they can't use REXX, and they require supplemental programs to perform even the most basic functions (e.g., dir or copy).

Installation is simple if not entirely straightforward: after unzipping 4OS2 into a directory of your choice you just run 4OS2.EXE. It will automatically add itself to your config.sys and create a folder for itself on the desktop, prompting for confirmation on both actions. The folder will contain icons for a 4OS2 command prompt and the documentation in INF format. If you approved the config.sys modifications, you'll need to reboot to make 4OS2 your default prompt; however, the icon in the folder links directly to 4OS2.EXE, so it can be used immediately without rebooting.

Basic features

The first thing one will discover while exploring 4OS2, is that many of the old commands have a bit of new functionality. For instance, move is no longer just an alias of ren; most notably, it will move files between drives now. The dir command sorts directory entries to the top of the list, for easier reading, and displays "allocated space" as well as file size in the summary info, allowing those using FAT file systems to know exactly how much disk space they're wasting.

There are also a slew of new functions within the command line itself. The command history will match partial lines: if you type a few characters and press the up arrow, it will scroll through only the previous commands that started with those characters, rather than making you search through the entire list. Or, for the visually inclined, press Ctrl-PgUp: you'll be greeted with a small overlaid window containing every command you've given so far.

Also handy is filename matching: at any point you can type a partial filename and press Tab to scroll through the files in the current directory that match what you've typed. If you do this at a blank command line it will only scroll through executable file types (EXE, CMD, etc.). Furthermore, this works with wildcards: r*.txt will match readme.txt and register.txt.

Did I say wildcards? You're not limited to measly * and ? with 4OS2. Its wildcards will go the distance with Unix regular expressions. Just to give you an example of the functionality here: ?[!aeiouy]*[1-9].txt will match all text files that end with a number and do not have a vowel as the second character. To top it off, you can also exclude files from a command with equally complex wildcards.

Aliases, etc.

Unix users know the power of aliases. JP Software does too. The concept is simple: take any given command line and define a single word that will execute it. As a simplistic example, an alias "ddir" could be created that executes "dir /ad"; then, any time you want to see a list of subdirectories, you would only need to type ddir. How many of us have several one-line .CMD files that do nothing but toss a couple of default switches onto an oft-used utility? Aliases remove the necessity for those little batch files, and speed up execution while they're at it since they're stored in RAM. Not only that, but 4OS2 allows you to assign aliases a key combination instead of a name: instead of ddir, you could assign that same function to Shift-F5.

In a similar class is 4OS2's file type association feature. Want to load all of your text files with EPM (OS/2's Enhanced Editor)? Associate the .txt extension with epm.exe, and you can call text files on the command line as if they were executable programs. Type readme and EPM opens up with readme.txt from the current directory.

Last but not least on the list of ways to redefine the way the shell works, is the 4OS2.INI file. In this file you can redefine just about everything: all the special characters and all the special key presses. Not only that, but you can define nifty things like colorized directory lists. If you want all of your text files to show up bright purple, this is the file to edit.

Legacies of DOS

One final feature worthy of note is 4OS2's enhancement of the batch file language, and especially the BTM file. BTM stands for Batch-To-Memory: it is the same as any .BAT or non-Rexx .CMD file, except that before execution the file is loaded into memory, compiled to bytecode, and closed. This gives a small performance boost, and also allows a batch file to perform operations on itself, since the file is no longer open by the time it's executing.

There are many other enhancements to batch files, but they really only serve to create compatibility between 4OS2 and its cousins, 4DOS and 4NT. OS/2's own Rexx is a far superior scripting language to batch, no matter how much improve the latter.

Of course...

I've barely skimmed the surface here. 4OS2 has a wealth of features that can only truly be done justice by the half-megabyte .INF manual it comes with. It is a truly powerful product, a fact attested to by its endurance; I remember using 4DOS more than half a decade ago when I first switched to the PC from my trusty Apple II, and even then it had been around for a while. On the other hand, it is in some ways more daunting to configure than a Unix-style shell. It's definitely not for everyone -- but at the same time, I think that everyone should try it out.

* * *

4OS2 3.01A

by JP Software
download from the OS/2 Supersite (ZIP, 642k)
Registration: US$69.95

Lief Clennon is a computer hobbyist and Team OS/2 member currently residing in Albuquerque, NM. He can usually be found badgering his friends on IRC.

Copyright © 1998 - Falcon Networking ISSN 1203-5696