| EPM startpage | Homepage | Contact me | SiteMap |
| EPM 6.03 and its command shell feature | - by Jörg Tiemann |
|
Summary: Using EPM's command shell feature you can use the standard OS/2 CLI (cmd.exe) within the EPM window. Thus without any additional software let alone costs you have a GUI for your command line activities providing you with long yearned for features as scrollback buffer, syntax highlighting and editing options. This alone should be reason enough to see if you like it. But for those of you who are still sceptic, I'll bring in some filename completion. Still not curious? Then go away! ;-) Caution! As english.e is the only national language file being distributed all menus and dialogues of your EPM will be in English after recompilation!
Lets start with a short analysis of what we have and what additional features we are yearning for. The standard OS/2-CLI (command line interface) is fast, it offers a stdin, a stout and a history. Moreover you can size a command line window up to 102 lines (if I'm not mistaken). Hey, you even have an insert- and a replace-mode! What? Doesn't take your breath away? And this is what we might yearn for:
Forget about the aliases, I have currently no means of providing you with them, but all the other features you will find in ...
Though IBM's Enhanced Editor for OS/2, better known as EPM, is OS/2 e-Zine!'s double Readers' Choice Award Winner in the category text editor or programming editor, only few people seem to be aware of its power. So it was no big surprise for me to see EPM and its command shell feature not mentioned when alterative CLIs (command line interpreter) and CLI enhancements were discussed in OS/2 e-Zine! 0312. Being an almost fanatic EPM user and regular user of that very feature myself I've decided to close that gap. In the following I presume that you are a little familiar with EPM and that there is a working EPM installation on your system that includes ETPM (the macro compiler), epm.e, epmshell.e and all the other macro files. These are files unfortunately not included in the EPM distribution that comes with Warp 4. If you need more information on how to get those files and how to get started with EPM, have a look at my EPM basics page.
Now invoke an EPM shell by pressing <Ctrl-I> or <ESc> and entering shell and - voila! - 'command_shell_1' (.GIF, 50K) is added to the current edit ring. This is a temporary file EPM uses to redirect in- and output of the OS/2 CLI (cmd.exe) into. With this file you can do everything you can do with any file: you can scroll through it, edit it, save it, print it, highlight it, set bookmarks - whatever you want. Lets examine closely what options we have by entering a dir at the epm prompt. The result may look as this:
Now believe it or not, the basic features are already there. With this temporary file you can do everything you can do with any file: you can scroll through it, edit it, save it, print it, highlight it, set bookmarks - whatever you want. Check it out, it has:
So far I've shown you two pictures and if you got the first one you have noticed
that the EPM shell can be highlighted as every other file can be. And this is very
easy to do. Just get my highlighting scheme (ZIP, 3K),
place it in the EPM directory, hit <Crtl-I> again and enter
togglecontrol 2 epmkwds.command_shell. Your EPM command shell now
might look like this (.GIF,55k).
OS/2 doesn't offer aliases. Thus you either have to use additional programs such as 4OS/2 to get this feature, or you have to achieve whatever you wanted to achieve with aliases by other means. Assuming that when you type dir you nearly always mean dir /oG-D /S then you are -- simply nuts. Nevertheless especially nuts people deserve a helping hand. So name this little batchfile mydir.cmd and put it somewhere in your PATH (no, not in your way! I mean into one of the directories listed in the PATH-Statement in your config.sys).
A script instead of an alias. REXX enormously enhances the possibilities such little scripts offer.
More to illustrate than to prove the previous sentence I give you a little example, a REXX script to change the current directory by looking up a shortcut for a often used directory in a list of often used directories and their shortcuts. This script, "Jörg's Jump2Directory" is its name, has now got its own page including a download source.
OS/2's cmd.exe unfortunately does not offer a "filename completion" as even the blatant excuse for an CLI in Windows 2000 does. Given this you might not be familiar with this term. Filename completion simply means that you don't have to type in all those often longish file and directory names. Instead you just type the beginning and then hit a completion key and then the shell tries to find a file or directory name starting with the letter(s) you provided. The result is inserted in your command line. If there is more than one possibility to complete your filename you can cycle through all the possible completions by repeatingly hitting the completion key. There are other shells (command line interfaces) for OS/2 which do offer this feature (YAOS, 4OS2, bash, ...), but unfortunately this shells do not work with(in) the EPM shell. Thus I have written an EPM macro to enhance the EPM shell with filename completion. Sounds interesting to you? OK, see ya on my Shellkram page then. There I will present you an EPM macro package of mine which is aimed at making the work in the EPM shell more comfortable.
An EPM shell cannot replace the usual command shell window completely. Depending on what you're about to do you'll have to choose an ordinary cmd.exe session from time to time. But in the mean time an EPM shell can be the highly customizable graphical command line interface you can do most of your daily command line work in -- enjoying features as described on this webpage. Regarding this it at least is a must-have-tried for every EPM user.
|
| EPM startpage | Top | Homepage | Contact me | SiteMap |
| Copyright © 1998-2002 - Jörg Tiemann | Last modified: Sun, 6 Jan 2002 |
|
|
|
|